Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

pdf

Class: gmdistribution

Probability density function for Gaussian mixture distribution

Syntax

y = pdf(obj,X)

Description

y = pdf(obj,X) returns a vector y of length n containing the values of the probability density function (pdf) for the gmdistribution object obj, evaluated at the n-by-d data matrix X, where n is the number of observations and d is the dimension of the data. obj is an object created by gmdistribution or fitgmdist. y(I) is the pdf of observation I.

Examples

expand all

Create a gmdistribution distribution 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])

Was this topic helpful?