ERROR: Initial covariance is required, even though I am giving it the covariance in gmdistribution.fit.

1 view (last 30 days)
I am trying to fit a Gaussian mixture model for data, I am calculated inital means, covariance and Pcomponents , and created a structure S. Then I use this command to fit the model.
opts = statset('MaxIter', 30);
obj = gmdistribution.fit(data,maxk,'Start',S,'CovType','diagonal','Options',opts);
Where S is a structure which has the means, covariance and Pcomponents in the desired format. But when I run it i always get the error.
Error using gmcluster>checkInitParam (line 384) The initial covariance is required.
Error in gmcluster (line 135) initPara=checkInitParam(start,k,d,CovType, SharedCov);
Error in gmdistribution.fit (line 174) [S,NlogL,optimInfo] =...
But I am giving it initial covariance, any input on this will be appreciated.
------- Eric

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!