Skip to contents

Check if a matrix is symmetric and positive definite

Usage

is.spd(..., tol = 1e-08)

Arguments

...

One or more numeric matrices

tol

Numerical tolerance for checking symmetry and positive definiteness

Value

A Boolean value indicating whether the matrix is symmetric and positive definite

Details

Function checks whether the matrix x is symmetric and positive definite. Symmetry is evaluated up to an entrywise tolerance of tol, so that differences smaller than tol are ignored. Positive-definiteness is checked by computing the eigenvalues of x using eigen, setting eigenvalues smaller than tol in absolute value to zero, and then checking whether any are less than or equal to zero.