chol2inv {base} | R Documentation |
Inverse from Choleski Decomposition
Description
Invert a symmetric, positive definite square matrix from its Choleski decomposition.
Usage
chol2inv(x, size = ncol(x))
La.chol2inv(x, size = ncol(x))
Arguments
x |
a matrix. The first |
size |
the number of columns of |
Details
chol
provides an interface to the LINPACK routine DPODI.
La.chol
provides an interface to the LAPACK routine DPOTRI.
Value
The inverse of the decomposed matrix.
References
Dongarra, J. J., Bunch, J. R., Moler, C. B. and Stewart, G. W. (1978) LINPACK Users Guide. Philadelphia: SIAM Publications.
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.
See Also
chol
, solve
.
Examples
cma <- chol(ma <- cbind(1, 1:3, c(1,3,7)))
t(cma) %*% cma # = ma
all.equal(diag(3), ma %*% chol2inv(cma))
all.equal(diag(3), ma %*% La.chol2inv(cma))