However, I found a bug. In Matlab R2013
for k=5:15
[W,M,V,L] = EM_GM(Data',k,0.001,1000,1,[]);
end
For certain k, it came out with error:
Attempted to access maxy(1); index out of bounds because numel(maxy)=0.

I noticed that some value in M were set as Nan.

However, for the same data in Matlab 7.1 it works perfectly fine.

28 Mar 2014

EM_GM
An expectation maximization algorithm for learning a multi-dimensional Gaussian mixture.
Author: Patrick Tsui