I have a dataset (vector) to which I would like to fit a gamma distribution (x), which given the shape seems reasonable. The charts below show the histograms of the two dataset: vector and x.
The left is my sample set, the right is a random generated set. I did this as following; first:
require(MASS)
fitdistr(vector,"gamma")
shape rate
4.84279 0.07493
(0.21693) (0.00354)
Then I generated the gamma distribution (right chart) as following:
hist(rgamma(10000, shape=4.84279, rate=0.07493),breaks=251)
I would like to change the shape in such a way that the peak gets slimmer, but I can not figure out how to do this. I have tried to modify the shape
and rate
, but neither of the two put me in the right direction. Does anybody have an advise on how to do this?
shape
parameter. Choosing a value slightly greater than $1$ will do the trick. But why do you need to fit a Gamma distribution to these data in the first place? $\endgroup$