Dear Augusto,
thank you for your example. Your solutions are the in fact the usual
methods, but these do not apply to my case because I have grouped data.
The good news is, that the solution of Prof. Brian Ripley works
perfectly -- of course :-)
Thank you both for your help.
Thomas P.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Petzoldt
Sent: Tuesday, 28 November 2006 10:26
To: r-help@stat.math.ethz.ch
Subject: [R] ML fit of gamma distribution to grouped data
Hello,
we have a set of biological cell-size data, which are only available
Hello,
we have a set of biological cell-size data, which are only available as
frequencies of discrete size classes, because of the high effort of
manual microscopic measurements.
The lengths are approximately gamma distributed, however the shape of
the distribution is relatively variable
library(stats4)
ll - function(shape, rate)
{
z - pgamma(breaks, shape=shape, rate=rate)
-sum(counts * log(diff(z)))
}
mle(ll, start=list(shape=1, rate=1/mean(breaks)))
looks a plausible fit.
On Tue, 28 Nov 2006, Thomas Petzoldt wrote:
Hello,
we have a set of biological cell-size