File Exchange

image thumbnail

1D infinite Gaussian mixture model

version (3.94 KB) by Mark Bangert
Implementation of Rasmussen's infinite Gaussian Mixture model for one dimensional data sets


Updated 07 Feb 2012

View Version History

View License

This is a little script which was designed for educational purposes. It runs out of the box and generates a random data set of 1D Gaussian mixtures and visualizes the inference process.


* Carl Edward Rasmussen: The infinite Gaussian mixture model ->

Cite As

Mark Bangert (2021). 1D infinite Gaussian mixture model (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)


I receive the recurring error:

Error using gammaln
Input must be nonnegative.
Error in mb_iGMM1D>@(x)exp((numOfClasses-3/2)*log(x)-.5/x+gammaln(x)-gammaln(x+numOfDataPoints)+gammaln(numOfDataPoints)) (line
alphaProbDensity = @(x)exp( (numOfClasses-3/2)*log(x) - .5/x + gammaln(x) - gammaln(x+numOfDataPoints) +
Error in mb_iGMM1D>mb_sliceSampling (line 276)
while customFunc(xLeft) > randStart
Error in mb_iGMM1D (line 138)
alpha = mb_sliceSampling(alphaProbDensity,alpha,1);


Just curious, why did you have to separate the code into two files as 1D and 2D?

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!