python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Module statistics :: Class FittedPowerLaw
[hide private]

Class FittedPowerLaw

source code

object --+
         |
        FittedPowerLaw

Result of fitting a power-law to a vector of samples

Example:

>>> result = power_law_fit([1, 2, 3, 4, 5, 6])
>>> result                   # doctest:+ELLIPSIS
FittedPowerLaw(continuous=False, alpha=2.425828..., xmin=3.0, L=-7.54633..., D=0.2138..., p=0.99311...)
>>> print result             # doctest:+ELLIPSIS
Fitted power-law distribution on discrete data
<BLANKLINE>
Exponent (alpha)  = 2.425828
Cutoff (xmin)     = 3.000000
<BLANKLINE>
Log-likelihood    = -7.546337
<BLANKLINE>
H0: data was drawn from the fitted distribution
<BLANKLINE>
KS test statistic = 0.213817
p-value           = 0.993111
<BLANKLINE>
H0 could not be rejected at significance level 0.05
>>> result.alpha             # doctest:+ELLIPSIS
2.425828...
>>> result.xmin
3.0
>>> result.continuous
False
Instance Methods [hide private]
 
__init__(self, continuous, alpha, xmin, L, D, p)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
summary(self, significance=0.05)
Returns the summary of the power law fit.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, continuous, alpha, xmin, L, D, p)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

summary(self, significance=0.05)

source code 

Returns the summary of the power law fit.

Parameters:
  • significance - the significance level of the Kolmogorov-Smirnov test used to decide whether the input data could have come from the fitted distribution
Returns:
the summary as a string

   Home       Trees       Indices       Help