\Header{theta.md}{Estimate theta of the Negative Binomial by Deviance}
\keyword{models}{theta.md}
\begin{Description}\relax
Given the estimated mean vector, estimate \code{theta} of the Negative Binomial
Distribution by equating the deviance to the residual degrees of freedom.
Analogue of a moment estimator.
\end{Description}
\begin{Usage}
\begin{verbatim}
theta.md(y, u, dfr, limit = 20, 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.mm}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: theta <- theta.md(y, fitted(fm), dfr = 123)
\end{ExampleCode}
\end{Examples}

