power_law_fit(x,
xmin=None,
method='discrete_approx')
| |
Fitting a power-law distribution to empirical data
-
- Parameters:
x - the data to fit, a list containing integer values
xmin - the lower bound for fitting the power-law. If
None, the smallest x value is used. This argument
makes it possible to fit only the tail of the distribution.
method - the fitting method to use. The following methods are
implemented so far:
-
continuous, hill: exact maximum
likelihood estimation when the input data comes from a
continuous scale. This is known as the Hill estimator. The
statistical error of this estimator is (alpha-1) / sqrt(n), where alpha is the
estimated exponent and n is the number of
data points above xmin. The estimator is
known to exhibit a small finite sample-size bias of order O(n^-1), which is small when n > 100.
-
discrete_approx: approximation of the maximum
likelihood estimation in discrete case (see Clauset et al
among the references). This is said to produce quite results
provided xmin >= 6 (approx.).
- Returns:
- the estimated power-law exponent
Reference:
-
MEJ Newman: Power laws, Pareto distributions and Zipf's law.
Contemporary Physics 46, 323-351 (2005)
-
A Clauset, CR Shalizi, MEJ Newman: Power-law distributions in
empirical data. E-print (2007). arXiv:0706.1062
|