View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Fast EM_GM

3.7 | 7 ratings Rate this file 11 Downloads (last 30 days) File Size: 10.5 KB File ID: #9659 Version: 1.0
image thumbnail

Fast EM_GM


Patrick Tsui (view profile)


16 Jan 2006 (Updated )

An expectation maximization algorithm for learning a multi-dimensional Gaussian mixture.

| Watch this File

File Information

EM_GM_fast is the modified version of EM_GM (EM algorithm for k multidimensional Gaussian mixture estimation) for speed enchancement suggested by Mr. Michael Boedigheimer. The functionalities of EM_GM_fast and EM_GM are identical.
Note: EM_GM_fast requires more memory than EM_GM to execute. If EM_GM_fast does not provide any speed gain or is slower than EM_GM, more memory is needed or EM_GM should be used instead.

Similar to EM_GM, EM_GM_fast is designed as a single file function (i.e. all sub functions are included in the same file) for convenience and portability.

Detail descriptions of all inputs and outputs are included in the file. EM_GM_fast can be controlled to plot 1D or 2D problems and display CPU time used as well as number of iterations.

X = zeros(600,2);
X(1:200,:) = normrnd(0,1,200,2);
X(201:400,:) = normrnd(0,2,200,2);
X(401:600,:) = normrnd(0,3,200,2);
[W,M,V,L] = EM_GM_fast(X,3,[],[],1,[])


Em Gm inspired this file.

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 6.5 (R13)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
29 Jul 2016 Tolentee

How can I apply this to a 3D brain image. (e.g. dimension: 170*170*170)??

Comment only
26 Oct 2014 Subhrodip

06 Feb 2011 CT

CT (view profile)

Hi Patrick,

I'm using your EM_GM_fast code. Could you please tell me is there the option that permits to estimate Gaussian mixtures with diagonal covariance matrices? Thank you.

Cong-Thanh Do

Comment only
07 Dec 2007 J Chi

Thank you!

10 Oct 2007 Nash Borges

Noticed something that may be incorrect. When using multiple mixtures, you cannot compute the log likelihood of all of the data under each mixture and then just sum them. You need to do the sum before going into the log domain. Or use an approximation:

12 May 2007 Hassen Drira

20 Apr 2007 Nicholas Michael

This implementation, although very fast and useful, unfortunately doesn't detect and prevent the collapse of a mixture component, resulting in divisions by zero, if the number of initial components selected is suboptimal.

01 Mar 2007 noryanti muhammad

21 Apr 2006 tijani dalleji

19 Jan 2006

Only the title is modified to describe this function better.

04 Apr 2016 1.0

Just updating the license.

Contact us