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)
a matrix. The first
the number of columns of
logical. Defunct and gives an error.
The inverse of the matrix whose Choleski 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.
This is an interface to the LAPACK routine
LAPACK is from https://www.netlib.org/lapack/ and its guide is listed
in the references.
Anderson. E. and ten others (1999) LAPACK Users' Guide. Third Edition. SIAM. Available on-line at https://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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.