Message-ID: <Pine.LNX.4.61.0508250850120.27464@gannet.stats>
Date: 2005-08-25T07:56:01Z
From: Brian Ripley
Subject: Poisson Distribution fitting
In-Reply-To: <200508250914.59962.mmiller@nassp.uct.ac.za>
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 at 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