[R] Fitdistr and MLE for parameter lambda of Poisson distribution
Bernardo Rangel tura
tura at centroin.com.br
Tue Feb 14 10:30:10 CET 2006
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)
[]s
Tura
More information about the R-help
mailing list