On 26/02/2016 4:09 AM, catalin roibu wrote:
I'm working in forestry research and need the fitting distribution for
forest structure in relation with diameter.
The tree diameter have been lumped into 4 cm diameter classes, forming the
diameter experimental distribution.
For fitting I used the gamma distribution and I obtained the distribution
parameters (scale and rate). After that I used the dgamma function and I
have the pdf values. My question is how to obtain fitted absolute frequency
to compare with the true frequency?

Since you're lumping into classes, you don't want the density, you want differences in the cumulative probability. So if your class runs from 4 to 8 cm, use something like

pgamma(8, shape, rate) - pgamma(4, shape, rate)

or the equivalent but a little obscure

diff(pgamma(c(8, 4), shape, rate))

Duncan Murdoch

P.S. Please keep discussion on the mailing list. I've cc'd this response there.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to