Learn R Programming

FactorCopulaModel (version 0.1.1)

isPosDef: Check if a square symmetric matrix is positive definite

Description

Check if a square symmetric matrix is positive definite

Usage

isPosDef(amat)

Value

TRUE if amat is positive definite, FALSE otherwise

Arguments

amat

symmetric matrix

Examples

Run this code
a1 = matrix(c(1,.5,.5,1),2,2)
a2 = matrix(c(1,1.5,1.5,1),2,2)
t1 = try(chol(a1))
t2 = try(chol(a2))
print(isPosDef(a1))
print(isPosDef(a2))

Run the code above in your browser using DataLab