Skip to content

Error in using mixGaussFit: Matrix must be positive definite #121

@rayleigh007

Description

@rayleigh007

OS: Windows & with Matlab 2015a

I was inputting a data=11 x 2180 comprises of 11 dimensions with 2180 observations to the function mixGaussFit(data, 2). It prompted the following error. How do i solved "Matrix must be positive definite."

Error using chol
Matrix must be positive definite.
Error in gaussSample (line 20)
A = chol(Sigma, 'lower');
Error in kmeansFit (line 42)
noise = gaussSample(zeros(1, length(v)), 0.01*diag(v), K);
Error in kmeansInitMixGauss (line 7)
[mu, assign] = kmeansFit(data, K);
Error in mixGaussFit>initGauss (line 38)
[mu, Sigma, model.mixWeight] = kmeansInitMixGauss(X, nmix);
Error in mixGaussFit>@(m,X,r)initGauss(m,X,r,initParams,prior) (line 24)
initFn = @(m, X, r)initGauss(m, X, r, initParams, prior);
Error in emAlgo (line 56)
model = init(model, data, restartNum);
Error in mixGaussFit (line 25)
[model, loglikHist] = emAlgo(model, data, initFn, @eStep, @mstep , ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions