Estimate theta of the Negative Binomial by Deviance

DESCRIPTION:

Given the estimated mean vector, estimate theta of the Negative Binomial Distribution by equating the deviance to the residual degrees of freedom. Analogue of a moment estimator.

USAGE:

theta.md(y, u, dfr, limit = 20, eps = sqrt(.Machine$single.eps))

REQUIRED ARGUMENTS:

y
Vector of observed values from the Negative Binomial.
u
Estimated mean vector.
dfr
Residual degrees of freedom (assuming theta known).

OPTIONAL ARGUMENTS:

limit
Limit on the number of iterations.
eps
Tolerance to determine convergence.

VALUE:

The required estimate of theta, as a scalar.

SEE ALSO:

, ,

EXAMPLES:

theta <- theta.md(y, fitted(fm), dfr = 123)