isSymPosDef: Is a Real Matrix Symmetric and Positive Definite?

View source: R/util.R

isSymPosDefR Documentation

Is a Real Matrix Symmetric and Positive Definite?

Description

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

Usage

isSymPosDef(x, ...)

Arguments

x

A real matrix.

...

Further arguments to isSymmetric for deciding on matrix symmetry.

Value

TRUE if x is both symmetric and positive definite. FALSE otherwise.

See Also

isSymmetric for testing if a matrix is symmetric.

Examples

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)


MAnorm2 documentation built on Oct. 29, 2022, 1:12 a.m.