cholupdate: Rank 1 update to Cholesky factorization

View source: R/chol.R

cholupdateR Documentation

Rank 1 update to Cholesky factorization

Description

function cholupdate, where R = chol(A) is the original Cholesky factorization of \bold{A}, returns the upper triangular Cholesky factor of \bold{A} + \bold{xx}^T, with \bold{x} a column vector of appropriate dimension.

Usage

cholupdate(r, x)

Arguments

r

a upper triangular matrix, the Cholesky factor of matrix a.

x

vector defining the rank one update.

References

Golub, G.H., Van Loan, C.F. (2013). Matrix Computations, 4th Edition. John Hopkins University Press.

See Also

chol

Examples

a <- matrix(c(1,1,1,1,2,3,1,3,6), ncol = 3)
r <- chol(a)
x <- c(0,0,1)
b <- a + outer(x,x)
r1 <- cholupdate(r, x)
r1
all(r1 == chol(b)) # TRUE

fastmatrix documentation built on Oct. 12, 2023, 5:14 p.m.