Skip to Main Content Skip to Search
Product Documentation

gmdistribution - Class: gmdistribution

Construct Gaussian mixture distribution

Syntax

obj = gmdistribution(mu,sigma,p)

Description

obj = gmdistribution(mu,sigma,p) constructs an object obj of the gmdistribution class defining a Gaussian mixture distribution.

mu is a k-by-d matrix specifying the d-dimensional mean of each of the k components.

sigma specifies the covariance of each component. The size of sigma is:

p is an optional 1-by-k vector specifying the mixing proportions of each component. If p does not sum to 1, gmdistribution normalizes it. The default is equal proportions.

Examples

Create a gmdistribution object defining a two-component mixture of bivariate Gaussian distributions:

mu = [1 2;-3 -5];
sigma = cat(3,[2 0;0 .5],[1 0;0 1]);
p = ones(1,2)/2;
obj = gmdistribution(mu,sigma,p);

ezsurf(@(x,y)pdf(obj,[x y]),[-10 10],[-10 10])

References

[1] McLachlan, G., and D. Peel. Finite Mixture Models. Hoboken, NJ: John Wiley & Sons, Inc., 2000.

See Also

cdf | cluster | fit | mahal | pdf | posterior | random

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS