Reputation: 85
I used scipy.stats.gamma.fit(data) to fit a gamma distribution to my data. I want to know what the mean of the resulting distribution is.
How do I find the mean of the fitted gamma distribution?
Upvotes: 2
Views: 1015
Reputation: 23637
The distributions in scipy.stats
have a mean
method that (unsurprisingly) computes the mean.
You take the fitted parameters returned by scipy.stats.gamma.fit
and pass them to scipy.stats.gamma.mean
:
data = stats.gamma.rvs(5, 2, size=1000); # generate example data
params = scipy.stats.gamma.fit(data)
print(scipy.stats.gamma.mean(*params))
# 6.99807037952
Upvotes: 5