Skip to content
Prev 323894 / 398503 Next

Gamma curve fit to data with specific bins

Hi Riu,

Very helpful. Thanks a million!

Andrew

-----Original Message-----
From: Rui Barradas [mailto:ruipbarradas at sapo.pt] 
Sent: 20 May 2013 23:49
To: Lorentz, Andrew
Cc: r-help at r-project.org
Subject: Re: [R] Gamma curve fit to data with specific bins

Hello,

You are fitting a vector other than the vector 'x'.
And you are mistaking the parameter scale for rate.

est <- fitdistr(x,"gamma")$estimate


#plot the gamma curve with the found parameters hist(x, breaks=Size, freq=FALSE, xlab="Drop Size", ylab="No. of Drops") curve(dgamma(x, rate=est["rate"], shape=est["shape"]),from=0, to=16, main="Gamma
	distribution", ylab="Probability", add = TRUE, col = "red")


Hope this helps,

Rui Barradas

Em 20-05-2013 16:44, Lorentz, Andrew escreveu: