File Exchange

image thumbnail

Fast ND multidimensional gaussian mixture random generator

version (6.04 KB) by Sebastien PARIS
A fast generator of gaussian mixture samples

1 Download

Updated 12 Oct 2011

View License

A fast generator of gaussian mixture samples with a general ND dimensional calling syntax.

Permit to sample from a simple multivariate process to several gaussian mixture in a easy way.

Please run mexme_sample_mvgm.m to compile on your own platform. (Be sure to mex -setup is done before)

Comments and Ratings (2)

Sebastien PARIS

Documentation, extra examples and how to compile is documented directly the the mex-file. As it's written, to compile on others plateforms, you have to proceed as follow :

mex -DranSHR3 -output sample_mvgm.dll sample_mvgm.c


mex -DranKISS -outputsample_mvgm.dll sample_mvgm.c


When compiling on Windows, MATLAB R2006a, it fails.

Saying that randint not defined.

Adding a macro at the beginning of the source file
#define ranKISS
#define ranSHR solves the problem.

Documentation and literature reference desired.


-Minor update for Linux systems

-Fixed bug with Linux64 & GCC

-Compatible with GCC compiler

-Fix Z = sample_mvgm(N , mu) call

-A more general syntax, Z = sample_mvgn return a univariate gaussian sample from N(0,1)

-Improve/correct help

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

Inspired: EM_MVGM