Cholesky: Cholesky multiplication with Toeplitz variance matrices.

CholeskyR Documentation

Cholesky multiplication with Toeplitz variance matrices.

Description

Multiplies the Cholesky decomposition of the Toeplitz matrix with another matrix, or solves a system of equations with the Cholesky factor.

Usage

cholZX(Z, acf)

cholXZ(X, acf)

Arguments

Z

Length-N or N x p matrix of residuals.

acf

Length-N autocorrelation vector of the Toeplitz variance matrix.

X

Length-N or N x p matrix of observations.

Details

If C == t(chol(toeplitz(acf))), then cholZX() computes C %*% Z and cholZX() computes solve(C, X). Both functions use the Durbin-Levinson algorithm.

Value

Size N x p residual or observation matrix.

Examples

N <- 10
p <- 2
acf <- exp(-(1:N - 1))

Z <- matrix(rnorm(N * p), N, p)
cholZX(Z = Z, acf = acf) - (t(chol(toeplitz(acf))) %*%  Z)

X <- matrix(rnorm(N * p), N, p)
cholXZ(X = X, acf = acf) - solve(t(chol(toeplitz(acf))), X)

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