updown {Matrix} | R Documentation |
Compute the up- or down-dated Cholesky decomposition
updown(update, C, L)
update |
logical ( |
C |
any R object, coercable to a sparse matrix (i.e., of
subclass of |
L |
a Cholesky factor, specifically, of class
|
an updated Cholesky factor, of the same dimension as L
.
Typically of class "dCHMsimpl"
(a sub class of
"CHMfactor"
).
signature(update = "character", C = "mMatrix", L = "CHMfactor")
..
signature(update = "logical", C = "mMatrix", L = "CHMfactor")
..
Contributed by Nicholas Nagle, University of Tennessee, Knoxville, USA
CHOLMOD manual, currently beginning of chapter~18. ...
dn <- list(LETTERS[1:3], letters[1:5]) ## pointer vectors can be used, and the (i,x) slots are sorted if necessary: m <- sparseMatrix(i = c(3,1, 3:2, 2:1), p= c(0:2, 4,4,6), x = 1:6, dimnames = dn) cA <- Cholesky(A <- crossprod(m) + Diagonal(5)) 166 * as(cA,"Matrix") ^ 2 uc1 <- updown("+", Diagonal(5), cA) ## Hmm: this loses positive definiteness: uc2 <- updown("-", 2*Diagonal(5), cA) image(show(as(cA, "Matrix"))) image(show(c2 <- as(uc2,"Matrix")))# severely negative entries ##--> Warning