Documentation

A.6 The mixed-effects model and its likelihood

From model to objective function

What you will learn

  • State the three levels of the model — population, individual, observation — and write the likelihood of a subject and of a data set.
  • Define the conditional objective \(J_i(\eta)\), the objective function value, and the three record types.
  • Compute, for one subject, the integral that every approximation tries to reach, and see what it is made of.

Prerequisites: A.1, A.4 and A.5.

The model

For subject \(i=1,\dots,N\) and observation \(j=1,\dots,n_i\),

\[ y_{ij}=f\bigl(t_{ij};\theta,\eta_i\bigr)+\text{residual}(\varepsilon_{ij}),\qquad \eta_i\sim N(0,\Omega),\qquad\varepsilon_{ij}\sim N(0,\Sigma). \]

Three levels are involved.

Level What varies Parameters
Population the typical value of every parameter \(\theta\)
Individual how a subject departs from the typical value \(\eta_i\), with covariance \(\Omega\)
Observation how a measurement departs from the subject's own curve \(\varepsilon_{ij}\), with covariance \(\Sigma\)

The prediction with the residual set to zero is written \(Y_{ij}(\eta_i)\) (the population parameters are fixed during an evaluation), and the residual enters through a model \(Y(\eta,\varepsilon)\) that page A.7 lists.

The likelihood

Given the random effects, the observations of a subject are independent with density \(p(y_i\mid\eta_i)\). The \(\eta_i\) are not observed, so the subject's likelihood integrates them out:

\[ L_i=\int p(y_i\mid\eta)\,p(\eta\mid\Omega)\,d\eta,\qquad L=\prod_{i=1}^NL_i . \]

For a Gaussian record, \(-2\log\bigl[p(y_i\mid\eta)p(\eta\mid\Omega)\bigr]\) is, up to constants,

\[ J_i(\eta)=\sum_{j}c_{ij}(\eta)+\eta^{\mathsf T}\Omega^{-1}\eta,\qquad c_{ij}(\eta)=\log V_{ij}(\eta)+\frac{\bigl(y_{ij}-Y_{ij}(\eta)\bigr)^2}{V_{ij}(\eta)}, \]

and, writing \(p\) for the number of active ETAs,

\[ \boxed{\ \mathrm{OFV}_i=-2\log L_i=\log\lvert\Omega\rvert+p\log2\pi-2\log\!\int e^{-J_i(\eta)/2}\,d\eta\ },\qquad \mathrm{OFV}=\sum_i\mathrm{OFV}_i . \]

The constant \(n_{\text{obs}}\log 2\pi\) of the observation density is omitted, which is the NONMEM convention. It does not change which parameters minimise the OFV, and it cancels in a comparison of two models fitted to the same observations.

The three record types. The observation contribution \(c_{ij}\) depends on a flag (F_FLAG in the control stream).

Flag Contribution \(c_{ij}(\eta)\) Meaning
0 \(\log V_{ij}+(y_{ij}-Y_{ij})^2/V_{ij}\) the usual Gaussian record
1 \(-2\log Y_{ij}\) \(Y\) is the likelihood of the record (a censored or categorical observation)
2 \(Y_{ij}\) \(Y\) is the \(-2\log\) likelihood

The one subject

The illustration below is used again on pages A.3, A.7, A.8 and A.11, so that every approximation is applied to the same numbers.

Worked illustration: the appendix subject. A 100 mg intravenous bolus into a one-compartment model:

\[ f_j(\eta)=\frac{D}{V}\exp\!\Bigl(-\frac{\mathrm{CL}\,e^{\eta}}{V}\,t_j\Bigr),\qquad D=100,\ V=20,\ \mathrm{CL}=4, \]

with one ETA on clearance, \(\omega^2=0.09\), a proportional residual error \(y=f(1+\varepsilon)\) with \(\sigma^2=0.04\) (so \(V_j=0.04f_j^2\)), and three observations:

\(t\) (h) 1 4 12
\(y\) (mg/L) 4.6 2.9 1.0
\(f(\eta=0)\) 4.0937 2.2466 0.4536

At the typical clearance the model underpredicts every point, most of all the last. A subject with a lower clearance fits better: the question is how much lower, and how plausible it is.

The integrand

The objective \(J(\eta)\) and the weight \(e^{-J(\eta)/2}\) that enters the integral, for a few values of \(\eta\):

\(\eta\) \(J(\eta)\) \(e^{-J/2}\) \(f\) at 1, 4, 12 h
−0.80 9.016 0.011 4.57, 3.49, 1.70
−0.60 2.143 0.342 4.48, 3.22, 1.34
−0.40 −2.711 3.879 4.37, 2.92, 1.00
−0.334 −3.182 4.909 4.33, 2.82, 0.90
−0.20 −0.052 1.026 4.24, 2.60, 0.70
0.00 31.976 0.000 4.09, 2.25, 0.45

Two things stand out. The weight peaks sharply near \(\eta=-0.334\) and is already negligible at the typical value \(\eta=0\) (\(J=31.98\)): this subject is very unlike the typical subject, as the data (a 12-hour concentration of 1.0 against a predicted 0.45) say. And \(J\) can be negative, because \(\log V_j\) is negative when the residual variance is below 1; an objective function value is not required to be positive.

The integral. Numerical quadrature of \(\int e^{-J(\eta)/2}d\eta\) over \([-3,3]\) gives \(1.13026\), and so

\[ \mathrm{OFV}_i=\log0.09+\log2\pi-2\log1.13026=-2.4079+1.8379-0.2449=-0.8150 . \]

(Quadrature is a reference calculation for a problem with one ETA. For realistic models the integral has as many dimensions as there are ETAs and the cost of a grid grows exponentially with that number; page A.8 and the following pages are the ways around it.)

Why a conditional likelihood is not enough

One might minimise \(J_i\) over both \(\theta\) and \(\eta_i\) (a "joint" estimate). That treats every \(\eta_i\) as a free parameter, with \(N\times p\) of them, and the variance \(\Omega\) is then underestimated because the \(\eta_i\) are fitted to the data. Integrating out \(\eta\) — the marginal likelihood above — is what makes \(\Omega\) a variance of a population rather than the spread of fitted values. The mode \(\hat\eta_i\) is still useful, as the centre of the approximation and as the individual's empirical Bayes estimate (page A.8).

Properties worth remembering

Property Statement
Independence the subjects are independent given the population parameters, so the OFV is a sum
Scale \(\mathrm{OFV}=-2\log L\) up to the omitted constant; smaller is better
Invariance a parameter transformation does not change the OFV (it changes the optimiser's path)
Comparability two OFVs are comparable only for the same observations, the same likelihood definition and, for a test, nested models (page A.13)

Review checklist

  • Can you write \(\mathrm{OFV}_i\) as an integral and say what each term is?
  • Do you know what F_FLAG 0, 1 and 2 mean?
  • Can you explain why a subject's objective can be negative?
  • Can you say why the marginal, not the conditional, likelihood is maximised?

See the previous page, the next page and the mathematical reference.