View License

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

» Watch video

Highlights from
Multivariate Gaussian Mixture Model Optimization by Cross Entropy

4.0 | 5 ratings Rate this file 7 Downloads (last 30 days) File Size: 31.8 KB File ID: #7055 Version: 1.2
image thumbnail

Multivariate Gaussian Mixture Model Optimization by Cross Entropy



04 Mar 2005 (Updated )

Stochastic multi-extremum optimization.

| Watch this File

File Information

Fit a multivariate gaussian mixture by a cross-entropy method. Cross-Entropy is a powerfull tool to achieve stochastic multi-extremum optimization.

Please visit for more informations

i) Please compile mex-files by the mexme_ce_gauss.m (if compiler is not setup, run mex -setup before.

ii) Run the program demo test_ce_mvgm.m

MATLAB release MATLAB 6.5 (R13)
Other requirements A C compiler
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
10 Sep 2013 vxxx

vxxx (view profile)

thanks for your reply

Comment only
09 Sep 2013 Sebastien PARIS


This toolbox fit a gaussian mixture with the CE approach ... If you need the mixture estimation to compute your entropies, in this case yes....

Comment only
05 Sep 2013 vxxx

vxxx (view profile)

my problem is to find entropy of each component in gaussian mixture model.. can i find using your code?

thanks in advance

Comment only
03 Aug 2010 Anton Andriyenko

Thanks for the reply. So, changing "unsigned long" to "int" in all files seems to have solved both problems. Probably not the cleanest solution but it works for now :-)

Comment only
02 Aug 2010 Sebastien PARIS


Yes, it's seems to have a bug on Linux 64 bits with GCC ... it's a question long int definition between 32 & 64 I think. On windows, it's working either on 32 or 64... I don't have a Linux 64 close to me to debug ...

Comment only
02 Aug 2010 Anton Andriyenko

02 Aug 2010 Anton Andriyenko

Very nice piece of software!
Have you tried to run it on Linux? Something seems to be wrong and I am not sure whether it is the compiler or something else. Basically sample_mvgm doesn't seem to work properly. The simple call
generates numbers in the range -10^10 to 10^10. Have you experienced something like that? Also the optimization runs much much slower (ca. 3x) than on Windows. According to the Matlab-profiler the bottleneck is in the last line of sample_gaussian_mixture when dirirnd is called.

I am running ubuntu 10.04 64bit on a i7 quad core
tried Matlab 2009b and 2010a
tried gcc-4.1 and gcc-4.4
always same behavior

Thanks for you help!

Comment only
06 Jul 2010 Geoffrey Lewen

Sorry---compiler is LCC.

Comment only
06 Jul 2010 Sebastien PARIS

and your C compiler ? LCC, MSVC ?

(mex -setup)

Comment only
05 Jul 2010 Geoffrey Lewen

Microsoft Windows XP Version 5.1 (Build 2600: SP2)
Intel Core(TM)2 Duo CPU T7300@2.00GHz
2.97GB RAM
MATLAB Version (R2010a)
Java VM Version: Java 1.6.0_12-b04
Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

* MATLAB Compiler Version 4.13 (R2010a

Thank You!

Comment only
05 Jul 2010 Sebastien PARIS

Geoffrey, please give you exact plateform, i.e., OS, CPU, Compiler and so on ... Thanks you

Comment only
05 Jul 2010 Geoffrey Lewen

mex files compile without error and test_ce_mvgm runs without error but hangs, requiring force-kill of Matlab 2010a to recover. Using debugger, so far, sample_gaussian_mixture.m is the routine hanging....

Comment only
14 Mar 2010 Sebastien PARIS

I think randnt is not well compiled. Did you had the correct option

mex -DranSHR3 randnt.c


mex -DranKISS randnt.c


Comment only
13 Mar 2010 Omid Aghazadeh

Solved that one. (Needed to compile mex files!)
Now, I get NaNs!
t = 2, current sol = NaN, global sol = Inf, d = 0
t = 3, current sol = NaN, global sol = Inf, d = 0
t = 4, current sol = NaN, global sol = Inf, d = 0

Comment only
13 Mar 2010 Omid Aghazadeh

Perhaps a revision is required for higher verions of matlab. Could not run the code on R2009b. Passing a 3XK matrix as input, I get
??? Index exceeds matrix dimensions.

Error in ==> ce_mvgm at 314
Rmax(indice1) = Ra(indice1)/9 + 2*Ra(indice1)/9;
Ra is of dimension 1X3 and indice1 has indexes up to 9.

Comment only
04 Dec 2006 feng shigang

04 Dec 2006 feng shigang

01 Dec 2005 George Uameres

What fun!
nice way to learn about gaussian mixture models.

16 Oct 2005 Michael Boedigheimer

Includes an optional animated display of the current solution as it converges, which is fun.
One nice feature is that it can estimate the number of guassian mixtures that are present. Given the correct starting number, it did better than the EM method I used (at least for the single challenging case I looked at).
Offers a lot of control of the starting and boundary conditions, which may be important in some applications.
Mostly written in c, with windows dll. means its less portable. Even so, it is still slow.

01 Aug 2005

V1.1 : -add extra parameters in the main function
       -mvgmmrnd & loglikelihood handle a more general synthax

29 Sep 2005

Missing randnt mex file in the Zip distribution.....

16 Aug 2006

V 1.2 -Add a better procedure to estimate weight's mixture
      -Fix some small bugss
      -Add pdf display

16 Aug 2006

V1.3 Missing files

14 Mar 2010 1.1

-Add mexme_ce_gauss.m to compile mex-files

07 Jul 2010 1.2

-Correct a problem with LCC compiler for dirirnd.c
-sample_mvgm.c compatible with GCC compiler

Contact us