how to model multivariate normal distribution in matlab?
显示 更早的评论
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
回答(1 个)
Peter Perkins
2012-11-27
0 个投票
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 个评论
Wei Cai Law
2012-11-28
编辑:Wei Cai Law
2012-11-28
类别
在 帮助中心 和 File Exchange 中查找有关 Gaussian Mixture Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
