The poweRlaw package
This package implements both the discrete and continuous maximum likelihood estimators for fitting the power-law distribution to data. It also provides function to fit log-normal and Poisson distributions. Additionally, a goodness-of-fit based approach is used to estimate the lower cut-off for the scaling region.
The code developed in this package was influenced from the python and R code found at Aaron Clauset's website. In particular, the R code of Laurent Dubroca.
To cite this package in academic work, please use:
Colin S Gillespie (2013). Fitting heavy tailed distributions: the poweRlaw package. R package version 0.20.1.
Installation
This package is hosted on CRAN and can be installed in the usual way:
install.packages("poweRlaw")
Alternatively, the development version can be install from from github using the devtools package:
install.packages("devtools")
library(devtools)
install_github("poweRlaw", "csgillespie", subdir="pkg")
Note Windows users have to first install Rtools.
Getting Started
To get started, load the package
library(poweRlaw)
then work the through the two vignettes: getting started and examples. Alternatively, you can access the vignettes from within the package:
vignette("poweRlaw")
vignette("examples")
The plots below show the line of best fit to the Moby Dick and blackout data sets (from Clauset et al, 2009).
Other information
- If you have any suggestions or find bugs, please use the github issue tracker
- Feel free to submit pull requests
- The package does have an associated test suite (see directory tests above). However, since some of tests take a while to run, I've not included the suite with the package.
- The vignette source code is the directory vignette above.