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.2.1.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

powerlaw-1.2.1.linux-x86_64.exe (85.3 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for powerlaw-1.2.1.tar.gz
Algorithm Hash digest
SHA256 deb0b6e9e15f40478c0c3cd64cc7e6110915f21b884888734a01100d77946f34
MD5 dfb78c47d3dcb6f634e8d949cfdbc961
BLAKE2b-256 f59d0c1bc27b528204c808e64dec458791699f2f4e98311c6e4c7d14cdd1a0c9

See more details on using hashes here.

File details

Details for the file powerlaw-1.2.1.linux-x86_64.exe.

File metadata

File hashes

Hashes for powerlaw-1.2.1.linux-x86_64.exe
Algorithm Hash digest
SHA256 a0bbc0e09d6ecf09a950a41be616a257b4d38d393b6c828ad29f8e999f22c7bf
MD5 7a505611b115b65ed5619c4d45e22126
BLAKE2b-256 cf449d02cfc4904ea9bc28a8d2306e3138fad599da9d62be36ed0111d665867e

See more details on using hashes here.

Supported by

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