I am trying to fit my data to Gaussian Mixture Model using matlab , but the problem is that I can't determine the optimal number of components to do this , Can any body help !!! Also if there are already build functions to get that optimal number please help .
Asked
Active
Viewed 5,438 times
1

Amro
- 123,847
- 25
- 243
- 454

Ameer Sameer
- 19
- 1
- 2
-
that's the classic "model selection" problem. There is no unique solution, only some heuristics to help you choose. check the link that YBE wrote. you can also search for "model selection" papers, you'l get a lot.. – Ran Jul 02 '12 at 15:21
3 Answers
3
Good reviews of the different approaches to find the optimal number of components for gaussian model mixture are :
- Assessing the number of components in mixture models: a review by A Oliveira-Brochado and FV Martins (2005) : available here
- Chapter 6 of Finite mixture models by McLachlan and Peel (2000)
PS : I don't have the solution for your problem in Matlab but BIC criterion is implemented in R package mclust

Pop
- 12,135
- 5
- 55
- 68
2
In Matlab , we already have 2 criterion: AIC and BIC implemented. Fit GMM
See code snippet: SRC: http://www.mathworks.in/help/stats/gmdistribution.fit.html
AIC = zeros(1,4);
obj = cell(1,4);
`for k = 1:4`
`obj{k} = gmdistribution.fit(X,k);`
`AIC(k)= obj{k}.AIC;`
`end`
[minAIC,numComponents] = min(AIC);
numComponents

arunava555
- 31
- 3
-
Well, `aic` does not work at all, but the `score` does. The `score` computes the per-sample average log-likelihood of the given data X (using sklearn GMM). – Mohd Oct 20 '20 at 09:08
0
The Infinite Gaussian Mixture Model (www.gatsby.ucl.ac.uk/~edward/pub/inf.mix.nips.99.pdf) can automatically learn the number of clusters.
This page (http://www.cs.brown.edu/~fwood/code.html) has some matlab code that implements it (I haven't tried the code).

user1149913
- 4,463
- 1
- 23
- 28