How to use Erlang Distribution Function Scipy

Viewed 412

I want to randomly generate numbers that follow a Erlang Distribution for an arrival process. I want to set the number of arrivals k as a parameter of the Erlang Distribution.

scipy.stats.erlang.rvs(a, loc=0, scale=1, size=1, random_state=None)

I am not so sure what loc and scale mean, as in the documentation they did not really clarify what they represent.

Any help would be appreciated.

1 Answers

As Erlang distribution is a particular case of the Gamma distribution, by checking the gamma documentation:

The probability density above is defined in the “standardized” form. To shift and/or scale the distribution use the loc and scale parameters. Specifically, gamma.pdf(x, a, loc, scale) is identically equivalent to gamma.pdf(y, a) / scale with y = (x - loc) / scale. Note that shifting the location of a distribution does not make it a “noncentral” distribution; noncentral generalizations of some distributions are available in separate classes.

In the case of Erlang distribution, a should be an integer and the scale should be 1/lambda.

Related