Learn R Programming

hdtg (version 0.3.4)

cholesky: Efficient Cholesky decomposition

Description

Compute Cholesky decomposition of a matrix.

Usage

cholesky(A)

Value

upper triangular matrix R such that A = U'U.

Arguments

A

matrix to decompose

See Also

harmonicHMC()

Examples

Run this code
# 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