Documentation

18.36 Worked example: exact linear likelihood

The frozen example uses three observations (9.7,10.5,11.1), population mean 10, random-intercept variance 0.25, and residual variance 0.16. The model is \(y_j=\theta+\eta+\varepsilon_j\).

After integrating ETA, the observation covariance has 0.41 on the diagonal and 0.25 off-diagonal. The exact constant-omitted OFV is 3.026240679, calculated as \(\log|C|+r^{\mathsf T}C^{-1}r\). The conditional mode is 0.357142857 and posterior variance 0.043956044.

Because prediction is linear in ETA and residual variance is constant, FO’s tangent is exact. FOCE and FOCE-I use a mode but recover the same marginal Gaussian result. Laplace is exact because the conditional log density is quadratic.

This is an essential unit test: it isolates likelihood algebra from nonlinear approximation. It is not evidence that methods coincide for PK models generally.

Step-by-step check

Subtract 10 to obtain residual vector ((-0.3,0.5,1.1)). Form \(C=0.25\mathbf1\mathbf1^{\mathsf T}+0.16I\), calculate its determinant and solve \(Cz=r\) instead of explicitly forming an inverse. The OFV is \(log|C|+r^{\mathsf T}z\). Independently, the mode follows from precision addition: posterior precision is (3/0.16+1/0.25), and its numerator is \(\sum r_j/0.16\). These two routes should agree with the CSV at full precision.

Now halve residual variance. The mode moves closer to the subject mean residual and posterior variance decreases. This sensitivity demonstrates the prior-data balance without any nonlinear approximation.

Common mistakes

Do not omit off-diagonal covariance after integration, add observation constants inconsistently, or round intermediate matrix inverses heavily.

Checklist

  • Reconstruct C exactly.
  • Verify determinant and quadratic form.
  • Calculate mode/posterior variance analytically.
  • Confirm all methods coincide.
  • Compare full precision from csvlinear_exact.csv.

Further reading

Return to linearisation before the nonlinear example.