Eigen_chol: Cholesky decomposition of a matrix

View source: R/EigenR.R

Eigen_cholR 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 SparseMatrix, real/complex

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)

EigenR documentation built on May 18, 2022, 9:05 a.m.