is.pd: Test Positive Definiteness of a List of Square Matrices
Description
It tests the positive definiteness of a square matrix or a list of square
matrices. It returns TRUE if the matrix is positive definite. It
returns FALSE if the matrix is either non-positive definite or not
symmetric. Variables with NA in the diagonals will be removed before
testing. It returns NA when there are missing correlations even after
deleting the missing variables.
When both row and column names are supplied they must agree; one-sided
dimension names do not affect the numerical symmetry test.
Usage
is.pd(x, check.aCov = FALSE, cor.analysis = TRUE, tol = 1e-06)
Value
If the input is a matrix, it returns TRUE, FALSE or
NA. If the input is a list of matrices, it returns a logical vector.
Arguments
x
A square matrix or a list of square matrices
check.aCov
If it is TRUE, it mirrors the checking in
asyCov.
cor.analysis
Whether the input matrix is a correlation or a
covariance matrix. It is ignored when check.aCov=FALSE.
tol
Tolerance (relative to largest variance) for numerical lack of
positive-definiteness in x. It is adopted from
mvrnorm.