This library: https://github.com/pbloem/powerlaws contains a power law generator used as follows:
List<Double> data = new Continuous(3.14, 2.5).generate(1000);
This generates 1000 points from the power law distribution with 3.14 as the minimum value and 2.5 as an exponent. It also has a discrete distribution and a continuous approximation of a discrete distribution. All of these distributions can also match existing data.
(Disclaimer: I wrote this library).
Peter source
share