theta.md {MASS} R Documentation

## Estimate theta of the Negative Binomial

### Description

Given the estimated mean vector, estimate `theta` of the Negative Binomial Distribution.

### Usage

```theta.md(y, mu, dfr, limit = 20, eps = .Machine\$double.eps^0.25)

theta.ml(y, mu, n, limit = 10, eps = .Machine\$double.eps^0.25,
trace = FALSE)

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

### Arguments

 `y` Vector of observed values from the Negative Binomial. `mu` Estimated mean vector. `n` Number of data points (defaults to length of `y`) `dfr` 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?

### Details

`theta.md` estimates by equating the deviance to the residual degrees of freedom, an analogue of a moment estimator.

`theta.ml` uses maximum likelihood.

`theta.mm` calculates the moment estimator of `theta` by equating the Pearson chi-square sum((y-μ)^2/(μ+μ^2/theta)) to the residual degrees of freedom.

### Value

The required estimate of `theta`, as a scalar. For `theta.ml`, the standard error is given as attribute `"SE"`.

`glm.nb`

### Examples

```quine.nb <- glm.nb(Days ~ .^2, data = quine)
theta.md(quine\$Days, fitted(quine.nb), dfr = df.residual(quine.nb))
theta.ml(quine\$Days, fitted(quine.nb))
theta.mm(quine\$Days, fitted(quine.nb), dfr = df.residual(quine.nb))
```

[Package MASS version 7.2-14 Index]