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).
new()Class constructor.
NormalToeplitz$new(N)
NSize of the NTz random vector.
A NormalToeplitz object.
size()Get the size of the NTz random vector.
NormalToeplitz$size()
Size of the NTz random vector.
logdens()Log-density function.
NormalToeplitz$logdens(z, acf)
zDensity argument. A vector of length N or an N x n_obs matrix where each column is an N-dimensional observation.
acfA vector of length N containing the autocorrelation (i.e., first row/column) of the Toeplitz variance matrix.
A scalar or vector of length n_obs containing the log-density of the NTz evaluated at its arguments.
grad()Gradient of the log-density with respect to parameters.
NormalToeplitz$grad(z, dz, acf, dacf, full_out = FALSE)
zDensity argument. A vector of length N.
dzAn N x n_theta matrix containing the gradient dz/dtheta.
acfA vector of length N containing the autocorrelation of the Toeplitz variance matrix.
dacfAn N x n_theta matrix containing the gradient dacf/dtheta.
full_outIf TRUE, returns the log-density as well (see 'Value').
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.
hess()Hessian of log-density with respect to parameters.
NormalToeplitz$hess(z, dz, d2z, acf, dacf, d2acf, full_out = FALSE)
zDensity argument. A vector of length N.
dzAn N x n_theta matrix containing the gradient dz/dtheta.
d2zAn N x n_theta x n_theta array containing the Hessian d^2z/dtheta^2.
acfA vector of length N containing the autocorrelation of the Toeplitz variance matrix.
dacfAn N x n_theta matrix containing the gradient dacf/dtheta.
d2acfAn N x n_theta x n_theta array containing the Hessian dacf^2/dtheta^2.
full_outIf TRUE, returns the log-density and its gradient as well (see 'Value').
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.
grad_full()Full gradient of log-density function.
NormalToeplitz$grad_full(z, acf, calc_dldz = TRUE, calc_dlda = TRUE)
zDensity argument. A vector of length N.
acfA vector of length N containing 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.
A list with elements:
ldensThe log-density evaluated at z and acf.
dldzThe length-N gradient vector with respect to z, if calc_dldz = TRUE.
dldaThe length-N gradient vector with respect to acf, if calc_dlda = TRUE.
clone()The objects of this class are cloneable with this method.
NormalToeplitz$clone(deep = FALSE)
deepWhether to make a deep clone.