power.law.fit {igraph} | R Documentation |
power.law.fit
fits a power-law distribution to a
data set.
power.law.fit(x, xmin = NULL, start = 2, ...)
x |
The data to fit, a numeric vector containing integer values. |
xmin |
The lower bound for fitting the power-law. If NULL, the
smallest value in |
start |
The initial value of the exponent for the minimizing function. Ususally it is safe to leave this untouched. |
... |
Additional arguments, passed to the maximum likelyhood
optimizing function, |
A power-law distribution is fitted with maximum likelyhood methods as recommended by Newman and (by default) the BFGS optimization (see mle) algorithm is applied.
The additional arguments are passed to the mle function, so it is possible to change the optimization method and/or its parameters.
An object with class ‘mle
’. It can be used to
calculate confidence intervals and log-likelihood. See
mle-class
for details.
Gabor Csardi csardi@rmki.kfki.hu
Power laws, Pareto distributions and Zipf's law, M. E. J. Newman, Contemporary Physics, in press.
# This should approximately yield the correct exponent 3 g <- barabasi.game(1000) # increase this number to have a better estimation d <- degree(g, mode="in") power.law.fit(d+1, 20)