using gampdf and gamfit

I have found values of gamma distribution using
Y = gampdf(1:40,9,0.5)
Now, from the data I have, I want to estimate the parameters A and B with which I generated gamma distribution values. I mean, I want to get values of A and B near to the 9 and 0.5 respectively.
I have used gamfit function like this:
phat = gamfit(Y)
but I get wrong A and B values. Where is the mistake?
Thank you.
Donatas

2 件のコメント

Star Strider
Star Strider 2014 年 3 月 14 日
Consider:
Y = gamrnd(9, .5, 40, 1);
Donatas
Donatas 2014 年 3 月 15 日
But why is it not possible to estimate these values using
Y = gampdf(1:40,9,0.5)
I mean, I have a set of points which describes time-concentration curve and I need to fit gamma distribution.

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

回答 (1 件)

Amr Hashem
Amr Hashem 2015 年 10 月 31 日
編集済み: Amr Hashem 2015 年 10 月 31 日

0 投票

firstly you have to use:
Y= gamfit(Data) % use Data not Y
then use :
G= gampdf(X,A,B)
plot(X,G)
the parameters depends on your Data, you can't change them

タグ

質問済み:

2014 年 3 月 14 日

編集済み:

2015 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by