[R] Unexpected failure of Cholesky docomposition
Hoffman, Gabriel
g@briel@hoffm@n @ending from m@@m@edu
Tue Nov 13 16:30:49 CET 2018
My understanding is that a Cholesky decomposition should work on any square, positive definite matrix. I am encountering an issue where chol() fails and give the error: "the leading minor of order 3 is not positive definite"
This occurs on multiple machines and version of R.
Here is a minimal reproducible example:
# initialize matrix
values = c(1,0.725,0,0,0.725,1,0.692,0,0,0.692,1,0.644,0,0,0.664,1)
B = matrix(values, 4,4)
# show that singular values are positive
svd(B)$d
# show that matrix is symmetric
isSymmetric(B)
# B is symmetric positive definite, but Cholesky still fails
chol(B)
Is this a numerical stability issue? How can I predict which matrices will fail?
- Gabriel
[[alternative HTML version deleted]]
More information about the R-help
mailing list