\Header{theta.mm}{Estimate theta of the Negative Binomial by Moments}
\keyword{models}{theta.mm}
\begin{Description}\relax
Given the mean estimate, calculate the moment estimator of \code{theta} by
equating \eqn{sum((y-\mu)^2/(\mu+\mu^2/\theta))}{} to the residual
degrees of freedom.\end{Description}
\begin{Usage}
\begin{verbatim}
theta.mm(y, u, dfr, limit = 10, eps = .Machine$double.eps^0.25)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{y}] Vector of observed values from the Negative Binomial.

\item[\code{u}] Estimated mean vector.

\item[\code{dfr}] Residual degrees of freedom (assuming \code{theta} known).

\item[\code{limit}] Limit on the number of iterations.

\item[\code{eps}] Tolerance to determine convergence.

\end{ldescription}
\end{Arguments}
\begin{Value}
The required estimate of \code{theta}, as a scalar.\end{Value}
\begin{SeeAlso}\relax
\code{\Link{glm.nb}}, \code{\Link{theta.ml}}, \code{\Link{theta.md}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Don't run: theta <- theta.mm(y, fitted(fm), dfr = 123)
\end{ExampleCode}
\end{Examples}

