Appendix L
Negative Binomial Regression
(Source: Cameron and Trivedi [1])
In the Poisson regression model has mean and variance . We now relax the variance assumption, because data almost always reject the restriction that the variance equals the mean, and we maintain the assumption that the mean is .
We use the general notation
(L.1)
to denote the conditional variance of . It is natural to continue to model the variance as a function of the mean, with
(L.2)
for some specified function and where is a scalar parameter. Most models specialize this to the general variance function
(L.3)
where the constant is specified. Analysis is usually restricted to two special cases, in addition to the Poisson case of
First, the NB1 variance function sets . Then the variance
(L.4)
is a multiple of the mean.
Second, the NB2 variance function sets . Then the variance is quadratic in the mean:
(L.5)
In both cases the dispersion parameter is to be estimated.
The most common implementation of the negative binomial is the NB2 model, with NB2 variance function . It has density
(L.6)
The function is a gamma function, defined as
It is shown that , if is an integer. Thus,
Substituting Equation (L.8) into (L.7), the log-likelihood function for exponential mean is therefore
(L.9)
The NB2 MLE is the solution to the first-order conditions
(L.10)
(L.11)
The NB1 log-likelihood function is
(L.12)
The NB1 MLE solves the first-order conditions
(L.13)
(L.14)