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

4 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Jeff Miller
Jeff Miller el 31 de Oct. de 2019
The sigma isn't really off. GMModel.Sigma is variance = sigma^2

Más respuestas (1)

Jeff Miller
Jeff Miller el 31 de Oct. de 2019
  1 comentario
Yan Guan
Yan Guan el 31 de Oct. de 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!

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by