The count regression model for panel data can be derived from the Poisson regression model. Consider the multiplicative one-way panel data model,
where
Here, are the individual effects.
In the fixed-effects model, the are unknown parameters. The fixed-effects model can be estimated by eliminating by conditioning on .
In the random-effects model, the are independent and identically distributed (iid) random variables, in contrast to the fixed effects model. The random-effects model can then be estimated by assuming a distribution for .
In the Poisson fixed-effects model, conditional on and parameter , is iid Poisson-distributed with parameter , and does not include an intercept. Then, the conditional joint density for the outcomes within the ith panel is
Because is iid Poisson(), is the product of Poisson densities. Also, is Poisson(). Then,
Thus, the conditional log-likelihood function of the fixed-effects Poisson model is given by
The gradient is
where
In the Poisson random-effects model, conditional on and parameter , is iid Poisson-distributed with parameter , and the individual effects, , are assumed to be iid random variables. The joint density for observations in all time periods for the ith individual, , can be obtained after the density of is specified.
Let
so that and :
Let . Because is conditional on and parameter is iid Poisson(), the conditional joint probability for observations in all time periods for the ith individual, , is the product of Poisson densities:
Then, the joint density for the ith panel conditional on just the can be obtained by integrating out :
where is the overdispersion parameter. This is the density of the Poisson random-effects model with gamma-distributed random effects. For this distribution, and ; that is, there is overdispersion.
Then the log-likelihood function is written as
The gradient is
and
where , and is the digamma function.
This section shows the derivation of a negative binomial model with fixed effects. Keep the assumptions of the Poisson-distributed dependent variable
But now let the Poisson parameter be random with gamma distribution and parameters ,
where one of the parameters is the exponentially affine function of independent variables . Use integration by parts to obtain the distribution of ,
which is a negative binomial distribution with parameters . Conditional joint distribution is given as
Hence, the conditional fixed-effects negative binomial log-likelihood is
The gradient is
This section describes the derivation of negative binomial model with random effects. Suppose
with the Poisson parameter distributed as gamma,
where its parameters are also random:
Assume that the distribution of a function of is beta with parameters :
Explicitly, the beta density with domain is
where is the beta function. Then, conditional joint distribution of dependent variables is
Integrating out the variable yields the following conditional distribution function:
Consequently, the conditional log-likelihood function for a negative binomial model with random effects is
The gradient is
and
and