Learn R Programming

mvLSW (version 1.0)

modchol: Modified cholesky decomposition.

Description

Evaluates the modified cholesky decomposition for a near-positive definite matrix.

Usage

modchol(A, tol = .Machine$double.eps) PosDefEst(A, tol = .Machine$double.eps)

Arguments

A
Square symmetric real matrix.
tol
Tolerance. At .Machine$double.eps by default.

Value

The command modchol returns either a list, described below, or NULL if the routine attempts to take the square-root of a negative number (hence A is assumed to not be near-positive definite). If a decomposition is evaluated successfully, then item in the returned list are:The command PosDefEst returns the positive definite symmetric square matrix if modchol is successful in determine a modified cholesky estimate. Otherwise PosDefEst returns NULL.

Details

modchol evaluates the modified cholesky decomposition for a near-positive defintie matrix. See reference for procedure. PosDefEst is a wrapper command for modchol that returns the positive definite matrix approximation to A.

References

Schnabel, R. B. and Eskow, E. 1999. "A Revised Modified Cholesky Factorization Algorithm." SIAM Journal on optimization, 9(4), 1135-1148.

See Also

AdjPositiveDef.

Examples

Run this code
  ##Positive Defintie Case
  M <- 0.9^apply(as.matrix(1:4),1,function(a){abs(a-(1:4))})
  modchol(M) ## Different estimate from chol(M) due to pivoting
  PosDefEst(M) ## Same as M

  ##Not Positive Definite 
  M2 <-M
  M2[2,2] <- 0.7
  eigen(M2)$values  ##has a negative eigenvalue
  L <- modchol(M2)
  L
  M2_est <- PosDefEst(M2)
  M2_est
  M2_est - M2 ## == diag(L$E)

Run the code above in your browser using DataLab