Re: Problems with gmdistribution
- From: "Ting Su" <nospam@xxxxxxxxxxxxx>
- Date: Mon, 28 Apr 2008 14:22:53 -0400
Jaime,
GMDISTRIBUTION implements the standard Expectation-Maximization (EM)
algorithm. In some cases, it may converge to a solution which contains
singular or close-singular covariance matrix for one or more components.
Those components usually contains a few data points almost lying in a
lower-dimensional subspace. A solution with singular covariance matrix is
usually considered as spurious. Sometimes, this problem may go away if you
try another set of initial values; Sometimes, this problem will always occur
because of any of the following reasons: (a) The number of dimension of
data is relatively high, but there are not enough observations. (b) Some of
the features(variables) of your data are highly correlated. (c) Some or all
the features are discrete. (d) You try to fit the data to too many
components.
In your case, it seems that the number of components that you used, fifty,
is too big. you can try to reduce the number of components. Generally,
there are also other ways that you can use to avoid getting
"Ill-conditioned covariance matrix" error message"
1. If you don't mind to get solutions with ill-conditioned covariance
matrix, you can use option 'Regularize' in the GMDISTRIBUTION/FIT function
to add a very small positive number to the diagonal of every covariance
matrix.
2. You can specify the value of 'SharedCov' to be true to use equal
covariance matrix for every component.
3 You can specify the value of 'CovType' to be 'diagonal' .
"Jaime Zamora" <jaime.zamora@xxxxxxxxx> wrote in message
news:b536f1bb-283d-4485-b437-0d34cef43ca5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,
I'm trying to cluster stocks with gaussian clustering. I tried this
code:
function c=generaclusters_gauss(X,k)
options = statset('Display','off');
obj = gmdistribution.fit(X,50,'Options',options);
c = cluster(obj,X);
Where X is the stock matrix (rows: days columns: stocks)
I got this error:
??? Error using ==> gmcluster>gmcluster_learn at 254
Ill-conditioned covariance created at iteration 2.
Error in ==> gmcluster>gmcluster_learn at 254
error('stats:gmdistribution:IllCondCov', ...
Error in ==> gmcluster at 181
[S0,ll0, optimInfo0] = gmcluster_learn...
Error in ==> gmdistribution.fit at 199
[S,NlogL,optimInfo] =...
Is there any workaround to this?
Best Regards,
Jaime
.
- References:
- Problems with gmdistribution
- From: Jaime Zamora
- Problems with gmdistribution
- Prev by Date: implementation of edge detection and segmentation of nuchal translucency
- Next by Date: Re: imshow won't listen to parent designation
- Previous by thread: Re: Problems with gmdistribution
- Next by thread: How to change a parameters of S function while I'm doing simulation
- Index(es):
Relevant Pages
|