theta.maxl: Estimate theta of the Negative Binomial by Maximum Likelihood
Description
Given the estimated mean vector, estimate theta of the Negative Binomial
Distribution. Based on theta.ml in library(MASS), but modified to avoid theta overflow problems.Usage
theta.maxl(y, mu, n, limit=20, eps=.Machine$double.eps^0.25, trace=FALSE)
Arguments
y
Vector of observed values from the Negative Binomial.
n
Residual degrees of freedom (assuming theta known).
limit
Limit on the number of iterations.
eps
Tolerance to determine convergence.
trace
logical: should iteration progress be printed?
Value
- The required estimate of
theta, as a scalar.