Given the estimated mean vector, estimate theta overdispersion parameter of the negative binomial distribution.
Arguments
- y
vector of observed values from the negative binomial.
- mu
estimated mean vector from generalized linear model
- n
number of data points (defaults to the sum of
weights)- weights
sample weights. If missing, set to 1
- left
left boundary for estimating theta on a log scale. So -10 corresponds to a minimum theta value of exp(-10)
- right
right boundary for estimating theta on a log scale
- tol
tolerance of optimization
Details
Estimate overdispersion parameter for negative binomial distribution using univariate optimization with Brent's method. For very large datasets, this can be much faster than the Newton-Raphson method used by MASS::theta.ml(). This is faster since the lgamma() function used in the likelihood is faster than the digamma() and trigamma() functions used in the score and information steps. Also, the univariate optimization is performed on log(theta), while the Newton-Raphson approach is performed on the original scale of theta.