check_posdef {remotePARTS} | R Documentation |
Check if a matrix is positive definite
Description
Check if a matrix is positive definite
Usage
check_posdef(M)
Arguments
M |
numeric matrix |
Details
check if a matrix is 1) square, 2) symmetric, and 3) positive definite
Value
returns a named logical vector with the following elements:
- sqr
logical: indicating whether
M
is square- sym
logical: indicating whether
M
is symmetric- posdef
logical: indicating whether
M
is positive-definitive
Examples
# distance matrix
M = distm_scaled(expand.grid(x = 1:3, y = 1:3))
# check if it is positive definitive
check_posdef(M)
# check if the covariance matrix is positive definitive
check_posdef(covar_exp(M, .1))
# non-symmetric matrix
check_posdef(matrix(1:9, 3, 3))
# non-square matrix
check_posdef(matrix(1:6, 3, 2))
[Package remotePARTS version 1.0.4 Index]