[R] Fitdistr and MLE for parameter lambda of Poisson distribution
Gregor Gorjanc
gregor.gorjanc at bfro.uni-lj.si
Tue Feb 14 09:57:48 CET 2006
Bernardo Rangel tura wrote:
> At 09:35 AM 2/10/2006, Gregor Gorjanc wrote:
>
>> Hello!
>>
>> I would like to get MLE for parameter lambda of Poisson distribution. I
>> can use fitdistr() for this. After looking a bit into the code of this
>> function I can see that value for lambda and its standard error is
>> estimated via
>>
>> estimate <- mean(x)
>> sds <- sqrt(estimate/n)
>>
>> Is this MLE? With my poor math/stat knowledge I thought that MLE for
>> Poisson parameter is (in mixture of LaTeX code)
>>
>> l(\lambda|x) \propto \sum^n_{i=1}(-\lambda + x_iln(\lambda)).
>>
>> Is this really equal to (\sum^n_{i=1} x_i) / n
>>
>> --
>> Lep pozdrav / With regards,
>> Gregor Gorjanc
>
>
> Gregor,
>
> If I understood your LaTeX You is rigth.
>
> If you don´t know have a command wich make this for you: fitdistr()
>
> Look:
>
>
>> d<- rpois(50,5)
>> d
> [1] 6 4 6 4 5 5 4 11 7 5 7 3 5 10 4 9 4 2 4 5 4 4
> 9 3 10
> [26] 4 3 9 6 7 5 4 2 7 3 6 7 8 6 6 3 3 3 2 5 4 3
> 8 5 7
>> library(MASS)
>> fitdistr(d,"Poisson")
> lambda
> 5.3200000
> (0.3261901)
Thanks for this, but I have already said in the first mail, that
fitdistr can help me with this. I was just "surprised" or knowledge
undernourished, that there is closed form solution for this. Look into
the source of fitdistr.
--
Lep pozdrav / With regards,
Gregor Gorjanc
----------------------------------------------------------------------
University of Ljubljana PhD student
Biotechnical Faculty
Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3 mail: gregor.gorjanc <at> bfro.uni-lj.si
SI-1230 Domzale tel: +386 (0)1 72 17 861
Slovenia, Europe fax: +386 (0)1 72 17 888
----------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
you have no certainty until you try." Sophocles ~ 450 B.C.
More information about the R-help
mailing list