Re: [R] Poisson Distribution fitting

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 25 Aug 2005 - 17:56:01 EST

On Thu, 25 Aug 2005, Mark Miller wrote:

> I am trying to fit a number of distributions to a set of data, I have used the
> fitdristr() funtion for most of the distributions, but Poisson is not one of
> the possible distributions. I found somewhee talking about using the gamlss
> package, but have been unable to find it again, any help would be greatly
> appreciated.

If you mean fitdistr in package MASS, it can be used. But the mle for a Poisson is just the sample mean.

> x <- rpois(250, 2.6)
> mean(x)

[1] 2.62
> fitdistr(x, dpois, list(lambda=2))

     lambda
   2.6203125
  (0.1023841)

You can even find the s.e. via mu/sqrt(n), here
> mean(x)/sqrt(250)

[1] 0.1657033

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Aug 25 18:29:06 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:55 EST