NormalCirculant: Multivariate normal with Circulant variance matrix.

NormalCirculantR Documentation

Multivariate normal with Circulant variance matrix.

Description

Provides methods for the Normal-Circulant (NCt) distribution, which for a random vector z of length N is defined as

z ~ NCt(uacf)   <=>   z ~ Normal(0, toeplitz(acf)),

where uacf are the Nu = floor(N/2)+1 unique elements of the autocorrelation vector acf, i.e.,

acf = (uacf, rev(uacf[2:(Nu-1)]),   N even,
    = (uacf, rev(uacf[2:Nu])),      N odd.

Methods

Public methods


Method new()

Class constructor.

Usage
NormalCirculant$new(N)
Arguments
N

Size of the NCt random vector.

Returns

A NormalCirculant object.


Method size()

Get the size of the NCt random vector.

Usage
NormalCirculant$size()
Returns

Size of the NCt random vector.


Method logdens()

Log-density function.

Usage
NormalCirculant$logdens(z, uacf)
Arguments
z

Density argument. A vector of length N or an N x n_obs matrix where each column is an N-dimensional observation.

uacf

A vector of length Nu = floor(N/2) containing the first half of the autocorrelation (i.e., first row/column) of the Circulant variance matrix.

Returns

A scalar or vector of length n_obs containing the log-density of the NCt evaluated at its arguments.


Method grad_full()

Full gradient of log-density function.

Usage
NormalCirculant$grad_full(z, uacf, calc_dldz = TRUE, calc_dldu = TRUE)
Arguments
z

Density argument. A vector of length N.

uacf

A vector of length Nu = floor(N/2) containing the first half of the autocorrelation (i.e., first row/column) of the Circulant variance matrix.

calc_dldz

Whether or not to calculate the gradient with respect to z.

calc_dldu

Whether or not to calculate the gradient with respect to uacf.

Returns

A list with elements:

ldens

The log-density evaluated at z and uacf.

dldz

The length-N gradient vector with respect to z, if calc_dldz = TRUE.

dldu

The length-Nu = floor(N/2)+1 gradient vector with respect to uacf, if calc_dldu = TRUE.


Method clone()

The objects of this class are cloneable with this method.

Usage
NormalCirculant$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


SuperGauss documentation built on March 18, 2022, 6:35 p.m.