dnormtz: Density of a multivariate normal with Toeplitz variance...

View source: R/dnormtz.R

dnormtzR Documentation

Density of a multivariate normal with Toeplitz variance matrix.

Description

Density of a multivariate normal with Toeplitz variance matrix.

Usage

dnormtz(X, mu, acf, log = FALSE, method = c("gschur", "ltz"))

Arguments

X

Vector of length N or N x n matrix, of which each column is a multivariate observation.

mu

Vector or matrix of mean values of compatible dimensions with X. Defaults to all zeros.

acf

Vector of length N containing the first column of the Toeplitz variance matrix.

log

Logical; whether to return the multivariate normal density on the log scale.

method

Which calculation method to use. Choices are: gschur for a modified version of the Generalized Schur algorithm of Ammar & Gragg (1988), or ltz for the Levinson-Trench-Zohar method. The former scales as O(N log^2 N) whereas the latter scales as O(N^2) and should only be used for N < 300.

Value

Vector of n (log-)densities, one for each column of X.

Examples

# simulate data
N <- 10 # length of each time series
n <- 3 # number of time series
theta <- 0.1
lambda <- 2
mu <- theta^2 * rep(1, N)
acf <- exp(-lambda * (1:N - 1))

X <- rnormtz(n, acf = acf) + mu

# evaluate log-density
dnormtz(X, mu, acf, log = TRUE)

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