| Contents | Index |
Gaussian mixture models
An object of the gmdistribution class defines a Gaussian mixture distribution, which is a multivariate distribution that consists of a mixture of one or more multivariate Gaussian distribution components. The number of components for a given gmdistribution object is fixed. Each multivariate Gaussian component is defined by its mean and covariance, and the mixture is defined by a vector of mixing proportions.
To create a Gaussian mixture distribution by specifying the distribution parameters, use the gmdistribution constructor. To fit a Gaussian mixture distribution model to data, use gmdistribution.fit.
| fit | Gaussian mixture parameter estimates |
| gmdistribution | Construct Gaussian mixture distribution |
All objects of the class have the properties listed in the following table.
| CovType | Type of covariance matrices |
| DistName | Type of distribution |
| Mu | Input matrix of means MU |
| NComponents | Number k of mixture components |
| NDimensions | Dimension d of multivariate Gaussian distributions |
| PComponents | Input vector of mixing proportions |
| SharedCov | true if all covariance matrices are restricted to be the same |
| Sigma | Input array of covariances |
Objects constructed with fit have the additional properties listed in the following table.
| AIC | Akaike Information Criterion |
| BIC | Bayes Information Criterion |
| Converged | Determine if algorithm converged |
| Iters | Number of iterations |
| NlogL | Negative of log-likelihood |
| RegV | Value of 'Regularize' parameter |
| cdf | Cumulative distribution function for Gaussian mixture distribution |
| cluster | Construct clusters from Gaussian mixture distribution |
| disp | Display Gaussian mixture distribution object |
| display | Display Gaussian mixture distribution object |
| fit | Gaussian mixture parameter estimates |
| mahal | Mahalanobis distance to component means |
| Probability density function for Gaussian mixture distribution | |
| posterior | Posterior probabilities of components |
| random | Random numbers from Gaussian mixture distribution |
| subsasgn | Subscripted reference for Gaussian mixture distribution object |
| subsref | Subscripted reference for Gaussian mixture distribution object |
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.
Generate data from a mixture of two bivariate Gaussian distributions using the mvnrnd function. Fit the resulting data.
Generate the data using 1000 points from each distribution.
MU1 = [1 2]; SIGMA1 = [2 0; 0 .5]; MU2 = [-3 -5]; SIGMA2 = [1 0; 0 1]; X = [mvnrnd(MU1,SIGMA1,1000);mvnrnd(MU2,SIGMA2,1000)]; scatter(X(:,1),X(:,2),10,'.') hold on

Fit a two-component Gaussian mixture model.
options = statset('Display','final'); obj = gmdistribution.fit(X,2,'Options',options);
18 iterations, log-likelihood = -7058.35
h = ezcontour(@(x,y)pdf(obj,[x y]),[-8 6],[-8 6]);

[1] McLachlan, G., and D. Peel. Finite Mixture Models. Hoboken, NJ: John Wiley & Sons, Inc., 2000.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |