[R] fitdistr question

Ben Bolker bbolker at gmail.com
Fri Feb 11 14:42:54 CET 2011


Antje Niederlein <niederlein-rstat <at> yahoo.de> writes:

> 
> Hi Ingmar, hi Dennis,
> 
> okay, you're right. I was expecting that the result would give the
> best fit to my data even if it's not a real poisson distribution. It
> looks somehow similar...
> But how to judge the goodness of fit? I was using the residual sum of
> squares. I'm not a statistician, so I'm not sure whether this method
> is the one to choose...
> If I estimate lambda with mle2() and use the RSS as criteria to
> minimize, my lambda is much smaller that with fitdistr().
> 

   There are many ways to define the "best fit"; RSS is one reasonable
option, maximum likelihood (which in the case of a Poisson distribution
is equivalent to least-squares weighted by a variance that is equal
to the expected mean, i.e. (y.obs-y.fitted)^2/y.fitted) is another. 
Which you choose really depends
on why you are calculating the estimates in the first place/
what you intend to use them for, although for Poisson data
maximum likelihood approaches are more widely accepted.



More information about the R-help mailing list