Skip to content

lneisenman/powerlaw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

powerlaw: A Python Package for Analysis of Heavy-Tailed Distributions =======

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.

Quick Links

Installation

Paper illustrating all of powerlaw's features, with figures

Code examples from manuscript, as an IPython Notebook Note: Some results involving lognormals will now be different from the manuscript, as the lognormal fitting has been improved to allow for greater numerical precision.

Documentation

Known Issues

Update Notifications, Mailing List, and Contacts

This code was developed and tested for Python 2.x with the Enthought Python Distribution, and later amended to be compatible with 3.x. The full version of Enthought is available for free for academic use.

Further Development -----------------powerlaw is open for further development. If there's a feature you'd like to see in powerlaw, submit an issue. Pull requests and offers for expansion or inclusion in other projects are welcomed and encouraged. The original author of powerlaw, Jeff Alstott, is now only writing minor tweaks, so contributions are very helpful.

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 50.0%
  • R 28.1%
  • TeX 21.3%
  • C 0.6%