log_chol {mmcif} | R Documentation |
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)
x |
A positive definite matrix or a vector with a log Cholesky decomposition. |
A numeric vector with the log Cholesky decomposition or a matrix with the inverse.
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)))