is.positive.definite {matrixcalc}R Documentation

Test matrix for positive definiteness

Description

This function returns TRUE of the argument, a square matrix x, is positive definite. The user chooses between a test of the eigenvalues of x or a Choleski decomposition of x.

Usage

is.positive.definite(x, tol, method = c("eigen", "chol"))

Arguments

x

a matrix

tol

a numeric tolerance level usually left out

method

a character string that specifies the method used

Details

For the eigenvalue approach, the eigenvalues should be positive. The Choleski decomposition only works for positive definite symmetric matrices.

Value

TRUE or FALSE.

Author(s)

Frederick Novomestky fnovomes@poly.edu

References

Magnus, J. R. and H. Neudecker (1999) Matrix Differential Calculus with Applications in Statistics and Econometrics, Second Edition, John Wiley.

Examples

A <- diag( 1, 3 )
is.positive.definite( A )
B <- matrix( c( 1, 2, 3, 4 ), nrow=2, byrow=TRUE )
is.positive.definite( B )

[Package matrixcalc version 1.0-1 Index]