11

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!

user1094206
  • 920
  • 1
  • 12
  • 24

1 Answers1

19

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 θ, respectively, in the wikipedia page.

Warren Weckesser
  • 110,654
  • 19
  • 194
  • 214
  • 1
    Interestingly, the data that I'm fitting now fits the beta distribution better than Gamma. It used to fit Gamma pretty well when I didn't set floc=0. Any clue why this might happen if the location parameter for Gamma is not used? – user1094206 Jun 07 '13 at 00:13