cholesky: Cholesky decomposition of a square matrix

View source: R/cholesky.R

Cholesky decomposition of a square matrixR Documentation

Cholesky decomposition of a square matrix

Description

Cholesky decomposition of a square matrix.

Usage

cholesky(x,parallel = FALSE)

Arguments

x

A square positive definite matrix.

parallel

A boolean value for parallel version.

Details

The Cholesky decomposition of a square positive definite matrix is computed. The use of parallel is suggested for matrices with dimensions of 1000 or more.

Value

An upper triangular matrix.

Author(s)

Manos Papadakis

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>

See Also

is.symmetric

Examples

x = matrix(rnorm(1000 * 50), ncol = 50)
s = cov(x)
system.time(a1 <- cholesky(s))
system.time(a2 <- chol(s))
all.equal(a1[upper.tri(a1)], a2[upper.tri(a2)])
x <- NULL
s <- NULL
a1 <- NULL
a2 <- NULL

Rfast documentation built on March 18, 2022, 7:41 p.m.