Is there a way to do a multi normal distribution fitting in Matlab?

4 次查看(过去 30 天)
I have a set of data with multi normal distribution. How can I do a distribution fitting in matlab to identify the mean and sigma for each one? Please see an example in JMP in the picture. Thank you so much for the help!
Screen Shot 2019-10-30 at 6.18.17 PM.png

采纳的回答

Jeff Miller
Jeff Miller 2019-10-31
The sigma isn't really off. GMModel.Sigma is variance = sigma^2

更多回答(1 个)

Jeff Miller
Jeff Miller 2019-10-31
  1 个评论
Yan Guan
Yan Guan 2019-10-31
Thank you for the answer. I was trying to use this for the fitting. Below are the commands I have tried.
%create a 2 component, 1 variable distribution
mu1 = -5;
mu2 = 2;
sigma1 = 1;
sigma2 = 0.5;
X = [normrnd(mu1,sigma1,[1000,1]);normrnd(mu2,sigma2,[1000,1])];
% use fitgmdist for the fitting
GMModel = fitgmdist(X,2);
% check the fitting result: mu and sigma
GMModel.mu
GMModel.Sigma
MModel.mu
ans =
1.9923
-5.0686
GMModel.Sigma
ans(:,:,1) =
0.2436
ans(:,:,2) =
1.0688
The result for the mu looks right, but the Sigma is off. I tried to understand why there is the difference. Really appreciate if anyone can help!

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by