Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the Gamma distribution in SciPy have three parameters?

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!

like image 378
user1094206 Avatar asked Jun 06 '13 13:06

user1094206


People also ask

How many parameters are in the gamma distribution?

In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions.

What are the parameters of gamma?

Gamma distributions have two free parameters, named as alpha (α) and beta (β), where; α = Shape parameter. β = Rate parameter (the reciprocal of the scale parameter)

What is gamma in Scipy?

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.

How do you find the parameters of a gamma distribution?

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)


1 Answers

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.

like image 180
Warren Weckesser Avatar answered Dec 27 '22 08:12

Warren Weckesser