# 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))
Run the code above in your browser using DataLab