| NormalToeplitz {SuperGauss} | R Documentation |
Multivariate normal with Toeplitz variance matrix.
Description
Provides methods for the Normal-Toeplitz (NTz) distribution defined as
z ~ NTz(acf) <=> z ~ Normal(0, toeplitz(acf)),
i.e., for a multivariate normal with mean zero and variance Tz = toeplitz(acf).
Methods
Public methods
Method new()
Class constructor.
Usage
NormalToeplitz$new(N)
Arguments
NSize of the NTz random vector.
Returns
A NormalToeplitz object.
Method size()
Get the size of the NTz random vector.
Usage
NormalToeplitz$size()
Returns
Size of the NTz random vector.
Method logdens()
Log-density function.
Usage
NormalToeplitz$logdens(z, acf)
Arguments
zDensity argument. A vector of length
Nor anN x n_obsmatrix where each column is anN-dimensional observation.acfA vector of length
Ncontaining the autocorrelation (i.e., first row/column) of the Toeplitz variance matrix.
Returns
A scalar or vector of length n_obs containing the log-density of the NTz evaluated at its arguments.
Method grad()
Gradient of the log-density with respect to parameters.
Usage
NormalToeplitz$grad(z, dz, acf, dacf, full_out = FALSE)
Arguments
zDensity argument. A vector of length
N.dzAn
N x n_thetamatrix containing the gradientdz/dtheta.acfA vector of length
Ncontaining the autocorrelation of the Toeplitz variance matrix.dacfAn
N x n_thetamatrix containing the gradientdacf/dtheta.full_outIf
TRUE, returns the log-density as well (see 'Value').
Returns
A vector of length n_theta containing the gradient of the NTz log-density with respect to theta, or a list with elements ldens and grad consisting of the log-density and the gradient vector.
Method hess()
Hessian of log-density with respect to parameters.
Usage
NormalToeplitz$hess(z, dz, d2z, acf, dacf, d2acf, full_out = FALSE)
Arguments
zDensity argument. A vector of length
N.dzAn
N x n_thetamatrix containing the gradientdz/dtheta.d2zAn
N x n_theta x n_thetaarray containing the Hessiand^2z/dtheta^2.acfA vector of length
Ncontaining the autocorrelation of the Toeplitz variance matrix.dacfAn
N x n_thetamatrix containing the gradientdacf/dtheta.d2acfAn
N x n_theta x n_thetaarray containing the Hessiandacf^2/dtheta^2.full_outIf
TRUE, returns the log-density and its gradient as well (see 'Value').
Returns
An n_theta x n_theta matrix containing the Hessian of the NTz log-density with respect to theta, or a list with elements ldens, grad, and hess consisting of the log-density, its gradient (a vector of size n_theta), and the Hessian matrix, respectively.
Method grad_full()
Full gradient of log-density function.
Usage
NormalToeplitz$grad_full(z, acf, calc_dldz = TRUE, calc_dlda = TRUE)
Arguments
zDensity argument. A vector of length
N.acfA vector of length
Ncontaining the autocorrelation of the Toeplitz variance matrix.calc_dldzWhether or not to calculate the gradient with respect to
z.calc_dldaWhether or not to calculate the gradient with respect to
acf.
Returns
A list with elements:
ldensThe log-density evaluated at
zandacf.dldzThe length-
Ngradient vector with respect toz, ifcalc_dldz = TRUE.dldaThe length-
Ngradient vector with respect toacf, ifcalc_dlda = TRUE.
Method clone()
The objects of this class are cloneable with this method.
Usage
NormalToeplitz$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.