log_chol function

Computes the Log Cholesky Decomposition and the Inverse

Computes the Log Cholesky Decomposition and the Inverse

Computes the log Cholesky decomposition and the inverse of it. The functions are provided as the log Cholesky decomposition is used in the parameterization of the covariance matrix.

log_chol(x) log_chol_inv(x)

Arguments

  • x: A positive definite matrix or a vector with a log Cholesky decomposition.

Returns

A numeric vector with the log Cholesky decomposition or a matrix with the inverse.

Examples

set.seed(1) S <- drop(rWishart(1, 10, diag(10))) log_chol(S) stopifnot(isTRUE(all.equal(S, log_chol_inv(log_chol(S)))), (NCOL(S) * (NCOL(S) + 1L)) %/% 2L == length(log_chol(S)))
  • Maintainer: Benjamin Christoffersen
  • License: GPL (>= 3)
  • Last published: 2022-07-17