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)
| Parameter | Description |
|---|---|
x |
a matrix. The first size columns of the upper triangle contain the Choleski decomposition of the matrix to be inverted. |
size |
the number of columns of x containing the Choleski decomposition. |
LINPACK |
logical. Defunct and ignored (with a warning for true value). |
# NOT RUN {
cma <- chol(ma <- cbind(1, 1:3, c(1,3,7)))
ma %*% chol2inv(cma)
# }