View source: R/lin_alg_blockinv.R
inv_woodbury | R Documentation |
Computes the inverse of (A + U C V) provided that the inverse of A and C exists.
inv_woodbury(A, U, C, V = t(U), method = "ge", simplify = TRUE)
A , U , C , V |
Either a caracas matrix, or a dense or a sparse matrix. |
method |
One of the methods that can be supplied to inv(). |
simplify |
Should temporary quantities be simplified? |
The inverse of (A + U C V)
Søren Højsgaard
if (has_sympy()) {
n <- 8
m <- 4
A <- diag_("a", n)
U <- round(10*(matrix(rnorm(n*m), nrow=n)))
U[U < 0] <- 0
U <- as_sym(U)
V <- t(U)
C <- diag_("c", m)
B <- A + U %*% C %*% V
B
Bi <- inv_woodbury(A, U, C)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.