chol2inv {base} | R Documentation |
Inverse from Cholesky (or QR) Decomposition
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
.
Usage
chol2inv(x, size = NCOL(x), LINPACK = FALSE)
Arguments
x |
a matrix. The first |
size |
the number of columns of |
LINPACK |
logical. Defunct and gives an error. |
Value
The inverse of the matrix whose Cholesky decomposition was given.
Unsuccessful results from the underlying LAPACK code will result in an error giving a positive error code: these can only be interpreted by detailed study of the FORTRAN code.
Source
This is an interface to the LAPACK routine DPOTRI
.
LAPACK is from https://netlib.org/lapack/ and its guide is listed
in the references.
References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J, Du Croz J, Greenbaum A, Hammerling S, McKenney A, Sorensen D (1999). LAPACK Users' Guide, series Software, Environments, and Tools, Third edition. Society for Industrial and Applied Mathematics, Philadelphia, PA. ISBN 9780898714470. doi:10.1137/1.9781611971811. https://netlib.org/lapack/lug/lapack_lug.html.
Dongarra J, Bunch J, Moler C, Stewart G (1979). LINPACK Users' Guide, series Other Titles in Applied Mathematics. Society for Industrial and Applied Mathematics. ISBN 9780898711721. doi:10.1137/1.9780898719604.
See Also
Examples
cma <- chol(ma <- cbind(1, 1:3, c(1,3,7)))
ma %*% chol2inv(cma)