chol                  package:base                  R Documentation

The Choleski Decomposition

Description:

     Compute the Choleski factorization of a symmetric (Hermitian),
     positive definite square matrix.

Usage:

     chol(x)

Arguments:

       x: a symmetric, positive definite matrix.

Details:

     Note that only the upper triangular part of `x' is used such that
     the above only holds when `x' is symmetric.

     If the matrix is not positive-definite an error is generated. A
     non-negative definite but not strictly positive-definite matrix
     may or may not give an error depending on the numerical errors.

Value:

     The upper triangular factor of the Choleski decomposition, i.e.,
     the matrix R such that R'R = x (see example).

References:

     Dongarra, J. J., Bunch, J. R., Moler, C. B. and Stewart, G. W.
     (1978) LINPACK Users Guide.  Philadelphia: SIAM Publications.

See Also:

     `chol2inv' for its inverse, `backsolve' for solving linear systems
     with upper triangular left sides.

     `qr', `svd' for related matrix factorizations.

Examples:

     ( m <- matrix(c(5,1,1,3),2,2) )
     ( cm <- chol(m) )
     t(cm) %*% cm  #-- = 'm'
     all(abs(m  -  t(cm) %*% cm) < 100* .Machine$double.eps) # TRUE

