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 columns of the upper triangle contain the Cholesky decomposition of the matrix to be inverted. size the number of columns of x containing the Cholesky decomposition. 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. and ten others (1999) LAPACK Users' Guide. Third Edition. SIAM. Available on-line at https://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.

chol, solve.

### Examples

cma <- chol(ma  <- cbind(1, 1:3, c(1,3,7)))
ma %*% chol2inv(cma)


[Package base version 4.3.0 Index]