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

3 ビュー (過去 30 日間)
Yan Guan
Yan Guan 2019 年 10 月 31 日
コメント済み: Yan Guan 2019 年 10 月 31 日
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 件のコメント
Yan Guan
Yan Guan 2019 年 10 月 31 日
Oh great! Now everything looks right! Thank you so much!

サインインしてコメントする。

その他の回答 (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