2
$\begingroup$

I am trying to fit some data using python scipy.fit with the gamma distribution.

This returns three parameters (alpha, loc, beta). I would like to use these parameters to generate some data in excel, but the gamma function in excel only take values of alpha and beta.

Could someone explain how the "loc" parameter is related to the gamma distribution and how I can alter alpha and beta to be correct?

$\endgroup$
1
$\begingroup$

Gamma function has three parametrizations:

  • With a shape parameter k and a scale parameter θ.
  • With a shape parameter α = k and an inverse scale parameter β = 1/θ, called a rate parameter.
  • With a shape parameter k and a mean parameter μ = k/β.

In Excel, the second, "standradized", form is used. But it's possible to shift and/or scale the distribution using the loc and scale parameters. Specifically, gamma.pdf(x, alfa, loc, scale) is identically equivalent to gamma.pdf(y, alfa) / scale with y = (x - loc) / scale.

Hence to generate data in Excel just apply loc as above and then use Excel function as usual with parameters, returned from scipy.fit

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.