Learn R Programming

MAnorm2 (version 1.2.2)

isSymPosDef: Is a Real Matrix Symmetric and Positive Definite?

Description

isSymPosDef checks if a real matrix is symmetric and positive definite.

Usage

isSymPosDef(x, ...)

Value

TRUE if x is both symmetric and positive definite.

FALSE otherwise.

Arguments

x

A real matrix.

...

Further arguments to isSymmetric for deciding on matrix symmetry.

See Also

isSymmetric for testing if a matrix is symmetric.

Examples

Run this code
x <- matrix(c(1, 0.5, 0.5, 2), nrow = 2)
isSymPosDef(x)

# Not positive definite.
x <- matrix(c(1, 0.5, 0.5, 0.2), nrow = 2)
isSymPosDef(x)

Run the code above in your browser using DataLab