how to model multivariate normal distribution in matlab?
Afficher commentaires plus anciens
I have a data set of ut, control input which i would like to model it as a mixture with K component Gaussian densities. p(ut) = sum(pi*(N(ut;mean;covariance)). Sum from 1 to the K. Pi is the mixing parameter. N denotes the multivariate normal density function. With only data set ut, i have to estimate the mean, covariance and the mixing parameter with expectation maximisation algorithm. Below is the code that i wrote trying to model it. i wonder if they are correct or did i miss out anything?
obju = gmdistribution.fit(U1',K,'SharedCov',true,'CovType','diagonal');
sigmau = obju.Sigma;
muu = obju.mu;
pu=0;
for k=1:T-m
pu = mvnpdf(U1(:,k),muu(1),sigmau)+mvnpdf(U1(:,k),muu(2),sigmau)+pu;
end
Réponses (1)
Peter Perkins
le 27 Nov 2012
0 votes
Wei, unless you want to evaluate each component's pdf separately, I think you want to use the pdf method of the gaussian mixture distribution that you've created with gmdistributin.fit:
Hope this helps.
1 commentaire
Wei Cai Law
le 28 Nov 2012
Modifié(e) : Wei Cai Law
le 28 Nov 2012
Catégories
En savoir plus sur Gaussian Mixture Models dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
