Computes log(det(X)) from the Cholesky factor of a
symmetric positive-definite matrix X as
2 * sum(log(diag(R))), which avoids forming the full
determinant and is numerically stable.
Arguments
- factor
An
amCholobject fromchol_factor.
Examples
m <- crossprod(matrix(rnorm(16), 4, 4)) + diag(4)
A <- adgeMatrix(m)
fac <- chol_factor(A)
chol_logdet(fac)
#> [1] 5.853034