\HeaderA{power.law.fit}{Fitting a power-law distribution function to discrete data}{power.law.fit}
\keyword{graphs}{power.law.fit}
\begin{Description}\relax
\code{power.law.fit} fits a power-law distribution to a
data set.
\end{Description}
\begin{Usage}
\begin{verbatim}
power.law.fit(x, xmin = NULL, start = 2, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] The data to fit, a numeric vector containing integer values.
\item[\code{xmin}] The lower bound for fitting the power-law. If NULL, the
smallest value in \code{x} will be used. This argument makes it
possible to fit only the tail of the distribution. 
\item[\code{start}] The initial value of the exponent for the minimizing
function. Ususally it is safe to leave this untouched.
\item[\code{...}] Additional arguments, passed to the maximum likelyhood
optimizing function, \code{\LinkA{mle}{mle}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A power-law distribution is fitted with maximum likelyhood
methods as recommended by Newman and (by default) the 
BFGS optimization (see \LinkA{mle}{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.
\end{Details}
\begin{Value}
An object with class \sQuote{\code{mle}}. It can be used to
calculate confidence intervals and log-likelihood. See
\code{\LinkA{mle-class}{mle.Rdash.class}} for details.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{References}\relax
Power laws, Pareto distributions and Zipf's law,
M. E. J. Newman, \emph{Contemporary Physics}, in press.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{mle}{mle}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# 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)
\end{ExampleCode}
\end{Examples}

