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 -> http://www.kyb.mpg.de/fileadmin/user_upload/files/publications/pdfs/pdf2299.pdf
Mark Bangert (2021). 1D infinite Gaussian mixture model (https://www.mathworks.com/matlabcentral/fileexchange/34839-1d-infinite-gaussian-mixture-model), MATLAB Central File Exchange. Retrieved .
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?
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!