Package igraph :: Module statistics
[hide private]
[frames] | no frames]

Module statistics

Statistics related stuff in igraph


License: Copyright (C) 2006-2007 Gabor Csardi <csardi@rmki.kfki.hu>, Tamas Nepusz <ntamas@rmki.kfki.hu> 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Classes [hide private]
  Histogram
Generic histogram class for real numbers
  RunningMean
Running mean calculator.
Functions [hide private]
 
power_law_fit(x, xmin=None, method='discrete_approx')
Fitting a power-law distribution to empirical data
Variables [hide private]
  __loader__ = <zipimporter object "/Library/Python/2.5/site-pac...
Function Details [hide private]

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 [hide private]

__loader__

Value:
<zipimporter object "/Library/Python/2.5/site-packages/python_igraph-0\
.5.1-py2.5-macosx-10.5-i386.egg/igraph/">