Skip to content
Prev 168403 / 398502 Next

Goodness of fit for gamma distributions

It sounds like you just want to graph it though. For gammas, it's nice
to graph the log of the density, because
the tail is so thin and long, so you don't see much otherwise:

mydata <- rgamma(10000, shape=1.1, rate=2.5)

# now suppose you fit a gamma distribution, and get these estimated parameters:
shapeest <- 1.101
rateest <- 2.49

h <- hist(mydata, breaks=50, plot=FALSE)
plot(h$mids, log(h$density))
curve(log(dgamma(x, shape=shapeest, rate=rateest)), add=TRUE)


#Remko


-------------------------------------------------
Remko Duursma
Post-Doctoral Fellow

Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753

Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia

Mobile: +61 (0)422 096908
On Wed, Jan 28, 2009 at 1:13 AM, Dan31415 <d.m.mitchell at reading.ac.uk> wrote: