-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isposdef() is incorrect #20004
Comments
The rounding during the computation of the Cholesky factorization can cause this. Generally, it is not possible to reliably test singularity of floating point matrices. The matrix you provided is actually not singular in its binary floating point representation julia> det(big(A))
2.13162820728030047872728228063319445882714347172137703267935663215914838016073e-16 Determinants are generally quite unreliable in numerical computations because the terms grow so fast so Sylverster's criterion is not really practical. In numerical computations, the test via Cholesky is in most cases what you want and it is fairly cheap so I don't think we'll change it. However, it might be a good idea to extend the documentation to explain the method and maybe also use the example here to show the limitations. I'll add the documentation label to the issue. |
@andreasnoack Can this be the summary of the situation here. I will add it to the docs along with the example after approval. |
I don't think it's necessary to mention Sylvester's criterion. |
isposdef() is claiming that some (though not all) positive-semi definite matrices are positive definite when they are not:
I'm not sure what's causing this behaviour -- it looks like isposdef() attempts to make a Cholesky decomposition of the matrix, and all positive semi-definite matrices have a Cholesky decomposition (though IIRC there is no general algorithm for finding them). It seems to me that it would be simpler to just implement Sylvestor's criterion with something like
Version info:
The text was updated successfully, but these errors were encountered: