powered by
Compute Cholesky decomposition of a matrix.
cholesky(A)
upper triangular matrix R such that A = U'U.
matrix to decompose
harmonicHMC()
# Larger example set.seed(123) B <- matrix(rnorm(16), 4, 4) B <- t(B) %*% B # Make symmetric positive definite U <- cholesky(B) U # Verify decomposition all.equal(B, t(U) %*% U)
Run the code above in your browser using DataLab