Approximate Inference for Multinomial Logit Models with Random Effects
Source:vignettes/approximations.Rmd
approximations.Rmd
The problem
A crucial problem for inference about non-linear models with random effects is that the likelihood function for such models involves integrals for which no analytical solution exists.
For given values of the random effects the likelihood function of a conditional logit model (and therefore also of a baseline-logit model) can be written in the form
However, this βcomplete dataβ likelihood function cannot be used for inference, because it depends on the unobserved random effects. To arrive at a likelihood function that depends only on observed data, one needs to used the following integrated likelihood function:
In general, this integral cannot be βsolvedβ, i.e.Β eliminated from the formula by analytic means (it is βanalytically untractableβ). Instead, one will compute it either using numeric techniques (e.g.Β using numerical quadrature) or approximate it using analytical techniques. Unless there is only a single level of random effects numerical quadrature can become computationally be demanding, that is, the computation of the (log-)likelihood function and its derivatives can take a lot of time even on modern, state-of-the-art computer hardware. Yet approximations based on analytical techniques hand may lead to biased estimates in particular in samples where the number of observations relative to the number of random offects is small, but at least they are much easier to compute and sometimes making inference possible after all.
The package βmclogitβ supports to kinds of analytical approximations, the Laplace approximation and what one may call the Solomon-Cox appoximation. Both approximations are based on a quadratic expansion of the integrand so that the thus modified integral does have a closed-form solution, i.e.Β is analytically tractable.
The Laplace approximation and PQL
Laplace approximation
The (first-order) Laplace approximation is based on the quadratic expansion the logarithm of the integrand, the complete-data log-likelihood
where is the solution to
and is the value of the negative Hessian with respect to
for .
Since this quadratic expansionβlet us call it βis a (multivariate) quadratic function of , the integral of its exponential does have a closed-form solution (the relevant formula can be found in Harville (1997)).
For purposes of estimation, the resulting approximate log-likelihood is more useful:
Penalized quasi-likelihood (PQL)
If one disregards the dependence of on and , then maximizes not only but also . This motivates the following IWLS/Fisher scoring equations for and (see Breslow and Clayton (1993) and this page):
where
is the IWLS βworking dependend variableβ with , , , and computed in an earlier iteration.
Substitutions lead to the equations:
and
which can be solved to compute and (for given )
Here
and
Following Breslow and Clayton (1993) the variance parameters in are estimated by minimizing
or the βREMLβ variant:
This motivates the following algorithm, which is strongly inspired by
the glmmPQL()
function in Brian Ripleyβs R package
MASS (Venables and Ripley 2002):
- Create some suitable starting values for , , and
- Construct the βworking dependent variableβ
- Minimize (quasi-ML) or (quasi-REML) iteratively (inner loop), to obtain an estimate of
- Obtain and based on the current estimate of
- Compute updated , , .
- If the change in is smaller than a given tolerance criterion stop the algorighm and declare it as converged. Otherwise go back to step 2 with the updated values of and .
This algorithm is a modification of the IWLS algorithm used to fit conditional
logit models without random effects. Instead of just solving a linear
requatoin in step 3, it estimates a weighted linear mixed-effects model.
In contrast to glmmPQL()
it does not use the
lme()
function from package nlme (Pinheiro and Bates 2000) for this, because the
weighting matrix
is non-diagonal. Instead,
or
are minimized using the function nlminb
from the standard
R package βstatsβ or some other optimizer chosen by the
user.
The Solomon-Cox approximation and MQL
The Solomon-Cox approximation
The (first-order) Solomon approximation (Solomon and Cox 1992) is based on the quadratic expansion the integrand
where is the gradient of
at , while is the negative Hessian at .
Like before, the integral of the exponential this quadratic expansion (which we refer to as ) has a closed-form solution, as does its logarithm, which is:
Marginal quasi-likelhood (MQL)
The resulting estimation technique is very similar to PQL (again, see Breslow and Clayton 1993 for a discussion). The only difference is the construction of the βworking dependentβ variable . With PQL it is constructed as while the MQL working dependent variable is just
so that the algorithm has the following steps:
- Create some suitable starting values for , , and
- Construct the βworking dependent variableβ
- Minimize (quasi-ML) or (quasi-REML) iteratively (inner loop), to obtain an estimate of
- Obtain based on the current estimate of
- Compute updated , , .
- If the change in is smaller than a given tolerance criterion stop the algorighm and declare it as converged. Otherwise go back to step 2 with the updated values of .