chol2inv {base} | R Documentation |
Invert a symmetric, positive definite square matrix from its Choleski decomposition. Equivalently, compute (X'X)^(-1) from the (R part) of the QR decomposition of X.
chol2inv(x, size = NCOL(x), LINPACK = FALSE)
x |
a matrix. The first |
size |
the number of columns of |
LINPACK |
logical. Should LINPACK be used (for compatibility with R < 1.7.0)? |
The inverse of the matrix whose Choleski decomposition was given.
This is an interface to the LAPACK routine DPOTRI
and the LINPACK
routine DPODI
.
LAPACK and LINPACK are from http://www.netlib.org/lapack and http://www.netlib.org/linpack and their guides are listed in the references.
Anderson. E. and ten others (1999) LAPACK Users' Guide. Third Edition. SIAM. Available on-line at http://www.netlib.org/lapack/lug/lapack_lug.html.
Dongarra, J. J., Bunch, J. R., Moler, C. B. and Stewart, G. W. (1978) LINPACK Users Guide. Philadelphia: SIAM Publications.
cma <- chol(ma <- cbind(1, 1:3, c(1,3,7))) ma %*% chol2inv(cma)