inv | R Documentation |
Calculates the inverse of a symmetric positive definite matrix from its Cholesky composition.
inv(a)
a |
a symmetric positive definite matrix |
This is an interface to the LAPACK routine DPOTRI implemented in the function
chol2inv
. The function calculates cholesky decomposition of the given
matrix and inputs this into chol2inv
.
The inverse of the given matrix.
Thomas Kvalnes
Anderson. E. et al. 1999. LAPACK Users' Guide. Third Edition. SIAM [Available online at: http://www.netlib.org/lapack/lug/lapack_lug.html].
chol
, chol2inv
#Example matrix mat <- matrix(c(1, 0.5, -3, 0.5, 3, 0.5, -3, 0.5, 12), ncol = 3) #Show that it is positive definite eigen(mat)$values #Calculate inverse inv(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.