chol2inv-methods: Inverse from Cholesky

Description Usage Arguments Methods References Examples

Description

Invert a symmetric, positive definite square matrix from its Cholesky decomposition. Equivalently, compute (X'X)^(-1) from the (R part) of the QR decomposition of X.
Even more generally, given an upper triangular matrix R, compute (R'R)^(-1).

Usage

1
2
## S4 method for signature 'dtrMatrix'
chol2inv(x, ...)

Arguments

x

a matrix(-like) object; see below.

...

not used here; for compatibility with other methods.

Methods

x = "dtrMatrix"

method for the numeric triangular matrices, built on the MAGMA magma_dpotri and PLASMA PLASMA_dpotri.

References

Martin Maechler, Douglas Bates (Matrix package)

Examples

1
2
3
4
(M  <- Matrix(cbind(1, 1:3, c(1,3,7))))
(cM <- chol(M)) # a "Cholesky" object, inheriting from "dtrMatrix"
chol2inv(cM) %*% M # the identity
stopifnot(all(chol2inv(cM) %*% M - Diagonal(nrow(M))) < 1e-10)

HiPLARM documentation built on May 29, 2017, 10:42 p.m.