Skip to content

shagunsodhani/powerlaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

powerlaw

Documentation Status

DOI

Power-Law Distribution Analysis based on Power-law distributions in Empirical data paper (Summary).

Basic use

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)

Install

sudo pip install git+https://github.com/shagunsodhani/powerlaw.git

Alternatively

git clone https://github.com/shagunsodhani/powerlaw.git

cd powerlaw

sudo python setup.py install

Features

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.

References

Clauset, Aaron, Cosma Rohilla Shalizi, and Mark EJ Newman. "Power-law distributions in empirical data." SIAM review 51.4 (2009): 661-703.

License

MIT