quadform_inv: Quadratic Form of the inverse of a matrix and a vector

Description Usage Arguments Details Value


We compute the quadratic form of a vector and the inverse of a matrix in an efficient manner. Let x be a real vector of length p, and let A be a p x p nonsingular matrix. Then, we compute the quadratic form q = x' A^{-1} x.





matrix that is p x p and nonsingular


vector of length p


A naive way to compute the quadratic form is to explicitly write t(x) %*% solve(A) %*% x, but for large p, this operation is inefficient. We provide a more efficient method below.

Note that we have adapted the code from: http://tolstoy.newcastle.edu.au/R/help/05/11/14989.html


scalar value

Search within the sparsediscrim package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.