Usually, the Gamma distribution has two parameters: shape and scale (or alternatively shape and rate). However, it seems that in SciPy the Gamma distribution has three parameters: two shape parameters and a location parameter.
Does anyone know the mapping between the SciPy parameters of Gamma, and, e.g., the parameters in the definition given on wikipedia:
http://en.wikipedia.org/wiki/Gamma_distribution
Thanks!
In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions.
Gamma distributions have two free parameters, named as alpha (α) and beta (β), where; α = Shape parameter. β = Rate parameter (the reciprocal of the scale parameter)
A gamma continuous random variable. As an instance of the rv_continuous class, gamma object inherits from it a collection of generic methods (see below for the full list), and completes them with details specific for this particular distribution. See also erlang , expon. Notes.
To estimate the parameters of the gamma distribution that best fits this sampled data, the following parameter estimation formulae can be used: alpha := Mean(X, I)^2/Variance(X, I) beta := Variance(X, I)/Mean(X, I)
All the continuous distributions in scipy.stats have location and scale parameters, even those for which the location is not generally used. For the gamma distribution, just leave the location at its default value 0. If you are using the fit
method, use the argument floc=0
to ensure that it does not treat the location as a free parameter.
The shape and scale parameters in the scipy gamma distribution correspond to k and theta, respectively, in the wikipedia page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With