R: Estimate theta of the Negative Binomial by Moments

theta.mm {MASS} | R Documentation

## Estimate theta of the Negative Binomial by Moments

### Description

Given the mean estimate, calculate the moment estimator of `theta` by equating sum((y-μ)^2/(μ+μ^2/theta)) to the residual degrees of freedom.

### Usage

    theta.mm(y, u, dfr, limit = 10, eps = .Machine$double.eps^0.25)

### 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.

### Value

The required estimate of `theta`, as a scalar.

### See Also

`glm.nb`, `theta.ml`, `theta.md`

### Examples

    ## Not run: theta <- theta.mm(y, fitted(fm), dfr = 123)

[Package Contents]