What are the loc and scale parameters in scipy.stats.maxwell?

5.1k Views Asked by At

The maxwell-boltzmann distribution is given by maxwell-boltzmann
(from MathWorld - A Wolfram Web Resource: wolfram.com)
. The scipy.stats.maxwell distribution uses loc and scale parameters to define this distribution. How are the parameters in the two definitions connected? I also would appreciate if someone could tell in general how to determine the relation between parameters in scipy.stats and their usual definition.

1

There are 1 best solutions below

0
On BEST ANSWER

The loc parameter always shifts the x variable. In other words, it generalizes the distribution to allow shifting x=0 to x=loc. So that when loc is nonzero,

maxwell.pdf(x) = sqrt(2/pi)x**2 * exp(-x**2/2), for x > 0

becomes

maxwell.pdf(x, loc) = sqrt(2/pi)(x-loc)**2 * exp(-(x-loc)**2/2), for x > loc.

The doc string for scipy.stats.maxwell states:

A special case of a chi distribution, with df = 3, loc = 0.0, and given scale = a, where a is the parameter used in the Mathworld description.

So the scale corresponds to the parameter a in the equation


(from MathWorld - A Wolfram Web Resource: wolfram.com)

In general you need to read the distribution's doc string to know what parameters the distribution has. The beta distribution, for example, has a and b shape parameters in addition to loc and scale.

However, I believe for all continuous distributions, distribution.pdf(x, loc, scale) is identically equivalent to distribution.pdf(y) / scale with y = (x - loc) / scale.