Up- and Down-Dating a Cholesky Decomposition

Share:

Description

Compute the up- or down-dated Cholesky decomposition

Usage

1

Arguments

update

logical (TRUE or FALSE) or "+" or "-" indicating if an up- or a down-date is to be computed.

C

any R object, coercable to a sparse matrix (i.e., of subclass of sparseMatrix).

L

a Cholesky factor, specifically, of class "CHMfactor".

Value

an updated Cholesky factor, of the same dimension as L. Typically of class "dCHMsimpl" (a sub class of "CHMfactor").

Methods

signature(update = "character", C = "mMatrix", L = "CHMfactor")

..

signature(update = "logical", C = "mMatrix", L = "CHMfactor")

..

Author(s)

Contributed by Nicholas Nagle, University of Tennessee, Knoxville, USA

References

CHOLMOD manual, currently beginning of chapter~18. ...

See Also

Cholesky,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.