remove_one_many_mat | R Documentation |
Efficiently calculate the inverse of a sub-matrix
remove_one_many_mat(A, i)
A |
A square inverse matrix |
i |
Vector of integers specifying the rows/columns to remove from B, see details |
For a given matrix A = B^-1, this will calculate the inverse of a submatrix of B given only matrix A and requiring only vector multiplication. B typically represents a covariance matrix for observations 1,...,N and the function is used to calculate the inverse covariance matrix for a subset of those observations.
The inverse of a submatrix of B
B <- matrix(runif(16),nrow=4,ncol=4) diag(B) <- diag(B)+1 A <- solve(B) remove_one_many_mat(A,1) #equal to solve(B[2:4,2:4])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.