-
Notifications
You must be signed in to change notification settings - Fork 36
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
PosDefException: matrix is not positive definite. #97
Comments
This looks like a numerical instability, indeed, I'd say something which this the output of So, in your case you could look at the The regulatization would make the algorithm more robust, which is a good thing. But I wonder if the data results in such numerical instabilities if the modelling of the data actually gives results that make sense. |
In
src/train.jl
using thekinit:kmeans
I get aERROR: PosDefException: matrix is not positive definite; Cholesky factorization failed.
as the covariance matrix usingcov(xx[sel, :])
at (row 130ish) seems not to fulfill the criteria for my data. It works forgmm.n<20
and also ifkinit=:split
for large nr mixtures.I solve it using a simple
isposdef
check followed by adding a small regularization term inmain.jl
.I tried to also to add the check in
scr/gmms.jl
in the functionand it works, but it resulted in roughly a 10% speed penalty (tested for 3x3 and 30x30), so perhaps the check might be best in
train.jl
?The text was updated successfully, but these errors were encountered: