How do you fit a gamma distribution?
Mostrar comentarios más antiguos
Hi There
How do you fit a gamma distribution to random data while fixing one of the gamma distribution parameters? Lets say we fix the shaping factor k for example and try to find the scaling factor Thetha of the gamma pdf? How is this done in Matlab?
Respuesta aceptada
Más respuestas (1)
Wayne King
el 7 de Abr. de 2012
You can use either mle() with the 'Distribution','gamma'
gamfit()
or fitdist() with 'gamma'. All require the Statistics Toolbox.
R = gamrnd(5,2,1e3,1);
gpdf = fitdist(R,'gamma');
[phat,phatci] = gamfit(R);
%same as
[phat,phatci] = mle(R,'Distribution','gamma');
Once you fix one of the parameters, you can create gamma pdfs by varying the other using gampdf and fit that to your data.
Categorías
Más información sobre Gamma Functions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!