Skip to content

Fitdistr and MLE for parameter lambda of Poisson distribution

5 messages · Peter Dalgaard, Gregor Gorjanc, Bernardo Rangel tura

#
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
#
Gregor Gorjanc <gregor.gorjanc at bfro.uni-lj.si> writes:
Yes....

Maximizing l(lambda) is the same as maximizing

sum(x)/n ln lambda - lambda

Now either take the derivative and set equal to zero, or
 
rewrite further as equivalent to

ln (lambda/(sum(x)/n)) -  (lambda/(sum(x)/n))

and notice that ln(x) - x has a global maximum at x=1 (since ln is
strictly concave and the tangent at x=1 is the line y = x - 1)
 

(I think this is in the first 20 pages I ever read on theoretical
statistics ...)

  
    
#
Peter Dalgaard wrote:
Thank you very much for this. It shows, how much I still need to learn.
3 days later
#
Bernardo Rangel tura wrote:
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.
#
At 09:35 AM 2/10/2006, Gregor Gorjanc wrote:
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