Eigen_chol {EigenR} | R Documentation |
Cholesky decomposition of a matrix
Description
Cholesky decomposition of a symmetric or Hermitian matrix.
Usage
Eigen_chol(M)
Arguments
M |
a square symmetric/Hermitian positive-definite matrix or
|
Details
Symmetry is not checked; only the lower triangular part of
M
is used.
Value
The upper triangular factor of the Cholesky decomposition of
M
.
Examples
M <- rbind(c(5,1), c(1,3))
U <- Eigen_chol(M)
t(U) %*% U # this is `M`
# a Hermitian example:
A <- rbind(c(1,1i), c(1i,2))
( M <- A %*% t(Conj(A)) )
try(chol(M)) # fails
U <- Eigen_chol(M)
t(Conj(U)) %*% U # this is `M`
# a sparse example
M <- asSparseMatrix(diag(1:5))
Eigen_chol(M)
[Package EigenR version 1.3.0 Index]