[frames] | no frames]

# Module statistics

Statistics related stuff in igraph

 Classes
` ` Histogram
Generic histogram class for real numbers
` ` RunningMean
Running mean calculator.

 Functions
` ` power_law_fit(x, xmin=None, method='discrete_approx')
Fitting a power-law distribution to empirical data

 Variables
` ` __license__ = `'\nCopyright (C) 2006-2007 Gabor Csardi <csardi@rmki...`
` ` __loader__ = `<zipimporter object "/Library/Frameworks/Python.fram...`

 Function Details

### 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

 Variables Details

 ```''' Copyright (C) 2006-2007 Gabor Csardi , Tamas Nepusz MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ... ```
 ``` ```