[R] Unexpected failure of Cholesky docomposition
William Dunlap
wdunl@p @ending from tibco@com
Tue Nov 13 18:31:47 CET 2018
Aren't singular values always positive or zero? Look at eigen(B)$values to
check for positive definiteness.
Fix your example - your B is not symmetric.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Nov 13, 2018 at 7:30 AM, Hoffman, Gabriel <gabriel.hoffman using mssm.edu>
wrote:
> 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]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]
More information about the R-help
mailing list