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


Download files

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

Source Distribution

powerlaw-1.3.5.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

powerlaw-1.3.5.macosx-10.5-x86_64.exe (87.2 kB view details)

Uploaded Source

File details

Details for the file powerlaw-1.3.5.tar.gz.

File metadata

  • Download URL: powerlaw-1.3.5.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for powerlaw-1.3.5.tar.gz
Algorithm Hash digest
SHA256 632df690ed41886fa0d468ff59ebd85c32c8d27846f21190e0b8fd0c35fdeda6
MD5 8619caf36a67682de057b8db2fafdce1
BLAKE2b-256 796b5546bcee0314ff27af47328f6e2f463309815b693774e2d06a249933f571

See more details on using hashes here.

File details

Details for the file powerlaw-1.3.5.macosx-10.5-x86_64.exe.

File metadata

File hashes

Hashes for powerlaw-1.3.5.macosx-10.5-x86_64.exe
Algorithm Hash digest
SHA256 30dea20896ae62cc3242b0fc8d0273d0de846087de683c9bc3fc9ad2fc735891
MD5 e10c64b357420852a8795ccc8c61aa8a
BLAKE2b-256 dc6636b24ffec56e7e57fee7bb44a45a9e8bdd78f09d29a462e1b9ba2a298f4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page