Skip to main content

Toolbox for testing if a probability distribution fits a power law

Project description

powerlaw is a toolbox using the statistical methods developed in Clauset et al. 2007 and Klaus et al. 2011 to determine if a probability distribution fits a power law. Academics, please cite as:

Jeff Alstott, Ed Bullmore, Dietmar Plenz. (2014). powerlaw: a Python package for analysis of heavy-tailed distributions. PLoS ONE 9(1): e85777

Also available at arXiv:1305.0215 [physics.data-an]

Basic Usage

For the simplest, typical use cases, this tells you everything you need to know.:

import powerlaw
data = array([1.7, 3.2 ...]) #data can be list or Numpy array
results = powerlaw.Fit(data)
print results.power_law.alpha
print results.power_law.xmin
R, p = results.distribution_compare('power_law', 'lognormal')

For more explanation, understanding, and figures, see the working paper, which illustrates all of powerlaw’s features. For details of the math, see Clauset et al. 2007, which developed these methods.

Acknowledgements

Many thanks to Andreas Klaus, Mika Rubinov and Shan Yu for helpful discussions. Thanks also to Andreas Klaus, Aaron Clauset, Cosma Shalizi, and Adam Ginsburg for making their code available. Their implementations were a critical starting point for making powerlaw.

Project details


Release history Release notifications

History Node

1.4.3

History Node

1.4.1

History Node

1.4

History Node

1.3.5

History Node

1.3.4

History Node

1.3.3

History Node

1.3.2

History Node

1.3.1

History Node

1.3

History Node

1.2.1

This version
History Node

1.2

History Node

1.1.1

History Node

1.1

History Node

1.0

History Node

0.8.3

History Node

0.8.2

History Node

0.8.1

History Node

0.8

History Node

0.4.2

History Node

0.4.1

History Node

0.4

History Node

0.3.1

History Node

0.3

History Node

0.2

History Node

0.1

History Node

.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
powerlaw-1.2.linux-x86_64.exe (85.2 kB) Copy SHA256 hash SHA256 Windows Installer any Jan 31, 2014
powerlaw-1.2.tar.gz (21.6 kB) Copy SHA256 hash SHA256 Source None Jan 31, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page