A.8 Approximating the integral: linearisation (FO, FOCE, FOCE-I) and Laplace
What you will learn
- Derive the linearised marginal likelihood of a subject from a first-order expansion of the model, and see how FO, FOCE and FOCE-I differ only in two choices.
- Derive the Laplace objective from a second-order expansion of \(J_i\) at its mode.
- Compare all four approximations with the exact integral for the appendix subject, and read the individual quantities (EBE, IPRED, IWRES, shrinkage) that the mode provides.
Prerequisites: A.2, A.3, A.6 and A.7.
The problem
The marginal likelihood of a subject is an integral over the ETAs that has no closed form when the prediction \(Y(\eta)\) is nonlinear in \(\eta\). If \(Y\) were linear, \(Y(\eta)=Y_0+G\eta\), with a residual variance not depending on \(\eta\), then \(y\) would be exactly Gaussian,
and the integral would be a Gaussian density: \(\mathrm{OFV}_i=\log\lvert C\rvert+(y-Y_0)^{\mathsf T}C^{-1}(y-Y_0)\) with \(C=G\Omega G^{\mathsf T}+R\). Every approximation in this page replaces the real model by a nearby simpler one for which the integral is available.
Linearisation
Expand the prediction around a point \(\eta^\star\):
Then \(y=Y(\eta^\star)-G\eta^\star+G\eta+\text{residual}\), which is Gaussian with mean \(Y(\eta^\star)-G\eta^\star\) and covariance \(C=G\Omega G^{\mathsf T}+R\). Defining the shifted residual \(r=y-Y(\eta^\star)+G\eta^\star\),
evaluated with the Woodbury identity and the determinant lemma of page A.2, so that only \(p\times p\) matrices are inverted. The three classical methods differ in two choices, the expansion point \(\eta^\star\) and the point at which \(R_i=\operatorname{diag}(V_{ij})\) is evaluated.
| Method | $EST |
expansion point \(\eta^\star\) | \(R_i\) evaluated at |
|---|---|---|---|
| FO | METHOD=0 |
\(0\) | \(0\) |
| FOCE | METHOD=1 |
\(\hat\eta_i\) (the conditional mode) | \(0\) |
| FOCE-I | METHOD=1 INTERACTION |
\(\hat\eta_i\) | \(\hat\eta_i\) |
The mode \(\hat\eta_i=\arg\min_\eta J_i(\eta)\) is found by an inner optimisation for every subject at every outer evaluation, which is why the conditional methods cost more than FO.
Laplace
Instead of linearising the prediction, expand the objective to second order at its mode:
(the first-order term vanishes at the mode). The integrand \(e^{-J_i/2}\) becomes a Gaussian kernel with precision matrix \(\tfrac12H_i\), whose integral is \(e^{-J_i(\hat\eta_i)/2}(2\pi)^{p/2}\lvert\tfrac12H_i\rvert^{-1/2}\). Substituting into the boxed formula of page A.6,
The \(p\log2\pi\) terms cancel. nlmx uses the exact Hessian (finite differences of the exact gradients, with a Gauss–Newton curvature if the Hessian is not positive definite). Laplace is the method used for records whose likelihood is supplied by the model (F_FLAG 1 and 2, page A.6), where a linearised Gaussian form does not apply.
The posterior of \(\eta_i\) given the data is approximated, in both families, by a Gaussian at the mode with covariance \(\bigl(\tfrac12H_i\bigr)^{-1}\); that matrix is what the .phi file stores for the classical methods.
A worked illustration
All four approximations and the exact value for the appendix subject (page A.6; the exact integral, by quadrature, gave \(\mathrm{OFV}_i=-0.8150\)).
| Method | expansion point | \(G\) at 1, 4, 12 h | \(\log\lvert C\rvert\) | \(r^{\mathsf T}C^{-1}r\) | \(\mathrm{OFV}_i\) | minus exact |
|---|---|---|---|---|---|---|
| FO | \(\eta^\star=0\) | −0.819, −1.797, −1.089 | −4.0598 | 2.7771 | −1.2827 | −0.468 |
| FOCE | \(\hat\eta=-0.3864\) | −0.593, −1.578, −1.596 | −3.3980 | 1.7959 | −1.6021 | −0.787 |
| FOCE-I | \(\hat\eta=-0.3343\) | −0.620, −1.615, −1.541 | −2.7366 | 1.6495 | −1.0871 | −0.272 |
| Laplace | \(\hat\eta=-0.3343\) | – | \(J(\hat\eta)=-3.1822\) | \(\log0.09=-2.4079\), \(\log\tfrac12H=4.8323\) | −0.7578 | +0.057 |
| exact (quadrature) | – | – | – | – | −0.8150 | 0 |
Here \(H=250.998\) at the FOCE-I mode, so \(\tfrac12H=125.5\) and the Gaussian approximation to the conditional distribution of \(\eta\) has SD \(\sqrt{1/125.5}=0.089\): a narrow peak compared with the population SD \(\omega=0.30\), because three well-spaced observations pin this subject's clearance down.
Four lessons can be read from the table.
- All four are within 0.8 of the exact value for this subject, and Laplace is within 0.06. A single subject's approximation error is small; what matters in a fit is how it varies with the parameters and accumulates over subjects.
- FOCE is farther from the exact value than FO here. That is the interaction effect of page A.7 at work: FOCE evaluates the proportional variance at \(\eta=0\), where \(V\) at 12 h is \(0.0082\), instead of \(0.0322\) at the subject's own \(\eta\). Moving the expansion point to the mode without moving the variance makes the approximation worse in this case, and the interaction version repairs most of it.
- The modes differ: \(-0.386\) (FOCE) against \(-0.334\) (FOCE-I). Same data, same model; the mode depends on how the variance is treated. This is why the label "conditional estimation" is incomplete without "with or without interaction".
- Of the three classical-style values, FOCE-I is closest to Laplace (a difference of 0.33, against 0.52 for FO and 0.84 for FOCE): both use the variance at the subject's own \(\eta\) and centre on the mode, and Laplace goes on to use the true curvature of \(J\) rather than that of a linearised model.
What the mode provides
At the mode, each subject has quantities the output files report.
| Quantity | Definition | Appendix subject |
|---|---|---|
| EBE \(\hat\eta_i\) | \(\arg\min_\eta J_i(\eta)\) | \(-0.334\) (\(-1.11\) population SDs) |
| PRED | \(Y(\eta=0)\) | 4.094, 2.247, 0.454 |
| IPRED | \(Y(\hat\eta_i)\) | 4.333, 2.820, 0.897 |
| IWRES | \(\bigl(y-\mathrm{IPRED}\bigr)/\sqrt{V(\hat\eta_i)}\) | 0.31, 0.14, 0.57 |
| WRES | \(L_0^{-1}(y-\mathrm{PRED})\), \(L_0L_0^{\mathsf T}=G_0\Omega G_0^{\mathsf T}+\operatorname{diag}V(0)\) | FO linearisation at 0 |
| CWRES | \(L^{-1}(y-\mathrm{IPRED}+G\hat\eta)\), \(LL^{\mathsf T}=G\Omega G^{\mathsf T}+\operatorname{diag}V(\hat\eta)\) | at the mode |
| ETA shrinkage | \(1-\mathrm{SD}(\hat\eta_{\cdot k})/\sqrt{\omega_{kk}}\) | over subjects |
| EPS shrinkage | \(1-\mathrm{SD}(\mathrm{IWRES})\) | over observations |
Shrinkage says how far the individual estimates have been pulled toward zero. With rich data each \(\hat\eta_i\) is close to the subject's true effect and the SD of the estimates approaches \(\omega\) (shrinkage near 0); with sparse data they stay near zero and shrinkage is high. High shrinkage makes diagnostic plots of \(\hat\eta_i\) and of IPRED misleading, because the estimates then reflect the prior more than the subject.
When the approximations fail
| Situation | Why the approximation suffers | What to do |
|---|---|---|
| strong nonlinearity in \(\eta\) | the expansion is poor away from its centre | Laplace, or an integral with draws (page A.11) |
| large between-subject variability | the true conditional density is far from Gaussian | the same |
| very sparse data per subject | the likelihood is flat and its Gaussian shape unreliable | prefer a stochastic method (page A.10) |
| residual variance that depends strongly on the prediction | FOCE and FOCE-I differ (the illustration) | use the interaction form |
| a censored or categorical record | the Gaussian form does not apply | Laplace or an importance-sampling objective |
Review checklist
- Can you derive the linearised objective, and say what \(r\) is?
- Can you say how FO, FOCE and FOCE-I differ, in two choices?
- Can you derive the Laplace objective from the second-order expansion, and say why \(p\log2\pi\) cancels?
- Do you know why FOCE can be farther from the exact value than FO, and what interaction repairs?
Navigation
See the previous page, the next page and the mathematical reference.