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

Module statistics



Statistics related stuff in igraph

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]
  __license__ = '\nCopyright (C) 2006-2007 Gabor Csardi <csardi@rmki...
  __loader__ = <zipimporter object "/Library/Frameworks/Python.fram...

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]

__license__

None
Value:
'''
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
...                                                                    
      

__loader__

None
Value:
<zipimporter object "/Library/Frameworks/Python.framework/Versions/2.4
/lib/python2.4/site-packages/python_igraph-0.5-py2.4-macosx-10.5-fat.e
gg/igraph/">