Estimate theta of the Negative Binomial Distribution
Usage
theta.mm(y, u, dfr, limit=10, eps=sqrt(.Machine$single.eps))
Arguments
y
|
Vector of observed values from the Negative Binomial.
|
u
|
Estimated mean vector.
|
dfr
|
Residual degrees of freedom (assuming theta known).
|
limit
|
Limit on the number of iterations.
|
eps
|
Tolerance to determine convergence.
|
Description
Given the mean estimate, calculate the moment estimator of theta by
equating
sum((y-mu)^2/(mu+mu^2/theta))
to the residual degrees of
freedom.Value
The required estimate of theta
, as a scalar.See Also
glm.nb
Examples
theta <- theta.mm(y, fitted(fm), dfr=123)