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

4 vues (au cours des 30 derniers jours)
Yan Guan
Yan Guan le 31 Oct 2019
Commenté : Yan Guan le 31 Oct 2019
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

Réponse acceptée

Jeff Miller
Jeff Miller le 31 Oct 2019
The sigma isn't really off. GMModel.Sigma is variance = sigma^2
  1 commentaire
Yan Guan
Yan Guan le 31 Oct 2019
Oh great! Now everything looks right! Thank you so much!

Connectez-vous pour commenter.

Plus de réponses (1)

Jeff Miller
Jeff Miller le 31 Oct 2019
  1 commentaire
Yan Guan
Yan Guan le 31 Oct 2019
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!

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by