from powerlaw.regression import estimate_parameters, goodness_of_fit data = [1.1, 2.2, 3.3, 4.4] (xmin, alpha, ks_statistics) = estimate_parameters(data) p_value = goodness_of_fit(data, xmin, alpha, ks_statistics)
sudo pip install git+https://github.com/shagunsodhani/powerlaw.git
git clone https://github.com/shagunsodhani/powerlaw.git cd powerlaw sudo python setup.py install
The current implementation supports fitting both continuous and discrete data to a power-law (using both Linear Regression and Maximum Likelihood Estimator method) and calculating the goodness of fit for the fitted power-law. Additionally, there are methods to generate random numbers for power-law, exponential and stretched exponential series. The complete documentation can be found here.
A short summary of the paper can be found here.