I am trying to simulate random variables that are power law distributed based on my understanding of the definition in this Wikipedia article and several other resources where the consensus is that a "power law distributed random variable" has the probability density function (PDF) of the form formula1 and in particular, I'm interested in the case where x_min=1
, which reduces to
formula2.
However, I've noticed that while the powerlaw
python package seems to use this definition, scipy.stats.powerlaw
uses a slightly different definition for powerlaw distributions and that is formula3 where alpha is positive and x is between 0 and 1 (inclusive), which we can rearrange if we let formula4 to the form formula5, which would match the form of formula2 (above) but with a negative sign in front of it, with the caveat that alpha would then be negative in the powerlaw
version.
The reason I was interested in using the SciPy version is that the Scipy package defines a "percent point function" (ppf) which can be used to generate a set of random values from uniformly distributed probabilities (i.e. the PPF is the inverse of the CDF).
So I'm trying to understand the difference between how the two packages define powerlaw distributions (are they even talking about the same thing?) so that I can translate from my distribution parameters (x_min and alpha) which seem to work under the Powerlaw model to the SciPy.Stats.powerlaw model in order to be able to use the PPF function.
Alternatively, if there is a way to use the Powerlaw package to generate random values from a set of uniformly distributed probabilities, I would greatly appreciate any pointers.