Documentation

gmdistribution

Class:gmdistribution

Construct Gaussian mixture distribution

Syntax

obj = gmdistribution(mu,sigma,p)

Description

obj = gmdistribution(mu,sigma,p)constructs an objectobjof thegmdistributionclass defining a Gaussian mixture distribution.

muis ak-by-dmatrix specifying thed-dimensional mean of each of thekcomponents.

sigmaspecifies the covariance of each component. The size ofsigmais:

  • d-by-d-by-kif there are no restrictions on the form of the covariance. In this case,sigma(:,:,I)is the covariance of componentI.

  • 1-by-d-by-kif the covariance matrices are restricted to be diagonal, but not restricted to be same across components. In this case,sigma(:,:,I)contains the diagonal elements of the covariance of component I.

  • d-by-dmatrix if the covariance matrices are restricted to be the same across components, but not restricted to be diagonal. In this case,sigmais the pooled estimate of covariance.

  • 1-by-dif the covariance matrices are restricted to be diagonal and the same across components. In this case,sigmacontains the diagonal elements of the pooled estimate of covariance.

pis an optional 1-by-kvector specifying the mixing proportions of each component. Ifpdoes not sum to1,gmdistributionnormalizes it. The default is equal proportions.

Examples

expand all

Create agmdistributiondistribution 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.

Introduced in R2007b

Was this topic helpful?