A.7 Residual-error models: where \(V_{ij}\) comes from
What you will learn
- Derive the residual variance \(V_{ij}=h_{ij}^{\mathsf T}\Sigma h_{ij}\) for the additive, proportional, combined and exponential error models, and see how the program obtains \(h\).
- Write a Gaussian observation's contribution to the objective, and the contribution of a censored (below-the-limit) observation under the M3 method.
- See why the interaction option matters for proportional error, with numbers.
The recipe
In the control stream, Y in $ERROR is a function of the prediction \(F\) and the residual terms \(\varepsilon\). nlmx does two things with it.
- It evaluates
Yat \(\varepsilon=0\) to get \(Y_{ij}(\eta)\), the prediction. - It differentiates
Ywith respect to each \(\varepsilon\) by symmetric (central) differences to get \(h_{ij}=\partial Y_{ij}/\partial\varepsilon\). The derivative is exact for the usual forms, which are linear in \(\varepsilon\).
The residual variance of an observation is then, to first order in \(\varepsilon\),
This is the delta method applied to the residual: for \(Y\approx Y(\eta,0)+h\,\varepsilon\), \(\operatorname{Var}(Y\mid\eta)=h^{\mathsf T}\Sigma h\) (page A.12).
The usual models
| Model | Y |
\(h=\partial Y/\partial\varepsilon\) | \(V\) |
|---|---|---|---|
| additive | \(F+\varepsilon_1\) | 1 | \(\sigma^2\) |
| proportional | \(F(1+\varepsilon_1)\) | \(F\) | \(F^2\sigma^2\) |
| combined (variance form) | \(F(1+\varepsilon_1)+\varepsilon_2\) | \((F,\ 1)\) | \(F^2\sigma_1^2+\sigma_2^2\) |
combined (SD form, as generate writes it) |
\(F+W\varepsilon\), \(W=\sqrt{\theta_p^2F^2+\theta_a^2}\) | \(W\) | \(W^2=\theta_p^2F^2+\theta_a^2\) |
| exponential | \(F\,e^{\varepsilon_1}\) | \(F e^{\varepsilon_1}\to F\) at \(\varepsilon=0\) | \(F^2\sigma^2\) to first order; \(\sigma^2\) if the data are modelled in log space |
| M3 (censored) | F_FLAG=1, \(Y=\Phi\bigl((\mathrm{LLOQ}-F)/W\bigr)\) |
– | the record is a likelihood, not a Gaussian density |
Two details. The two combined forms are the same family written with different parameters: \(\sigma_1=\theta_p\) and \(\sigma_2=\theta_a\). And the generated control streams guard the SD: \(W=\max(W,10^{-6})\), so a zero SD cannot divide.
The observation's contribution
For a Gaussian record, minus twice the log density, without the constant \(\log2\pi\), is
The two terms pull in opposite directions. The second term wants a large \(V\) (a large variance makes any residual cheap); the first term charges for it. The minimum of \(c\) over \(V\), for a given residual \(e\), is at \(V=e^2\), where \(c=\log e^2+1\).
For a censored observation under the M3 method, the observation is known only to lie below the limit of quantification (LLOQ). Its likelihood is the probability of that event,
with F_FLAG=1, so the record's \(Y\) is that probability and the contribution is \(-2\log Y\) (page A.6). A measured value contributes through the density, a censored one through this tail probability, and both enter the same sum.
A worked illustration
The appendix subject at its mode, \(\hat\eta=-0.334\). The predictions are \(f=4.333,\ 2.820,\ 0.897\) and the residuals \(y-f=0.267,\ 0.080,\ 0.103\).
| Error model | \(V\) at 1, 4, 12 h | contributions \(c_j\) | \(\sum c_j\) | standardised residuals \((y-f)/\sqrt V\) |
|---|---|---|---|---|
| proportional, \(\sigma^2=0.04\) | 0.751, 0.318, 0.0322 | −0.191, −1.125, −3.107 | −4.424 | 0.31, 0.14, 0.57 |
| additive, \(\sigma^2=0.04\) | 0.04, 0.04, 0.04 | −1.437, −3.059, −2.954 | −7.450 | 1.34, 0.40, 0.52 |
| combined, \(\sigma_1^2=0.04\), \(\sigma_2^2=0.01\) | 0.761, 0.328, 0.0422 | −0.179, −1.095, −2.914 | −4.189 | 0.31, 0.14, 0.50 |
The error model changes how the three observations are weighed. Under additive error the 1-hour residual (0.267, the largest in absolute terms) is the most surprising (1.34 SDs) because the SD is the same 0.2 for every concentration; under proportional error the SD at 12 h is only 0.18 for a concentration of 0.9 and the standardised residuals are all below 0.6. The totals are not comparable across rows: they come from different variance models (and from different mode locations in a real fit); they only show the mechanism.
The M3 contribution. Suppose the 12-hour observation were reported as "below the LLOQ of 0.5 mg/L", with the SD-form combined model \(\theta_p=0.2\), \(\theta_a=0.1\) at \(F=0.897\):
The model gives only a 2.7 % probability to a value below 0.5 at this prediction, so the censored record is costly; a lower predicted \(F\) would make it cheaper, and the fit would shift toward it. That is the information a censored record carries, and the information that is thrown away if such records are dropped.
Interaction
The variance depends on \(\eta\) through \(F(\eta)\) for proportional and combined errors. Two choices follow, and they define two of the methods of page A.8.
| Choice | \(V_{ij}\) evaluated at | Method |
|---|---|---|
| no interaction | \(\eta=0\) | FOCE |
| interaction | the subject's own \(\eta\) (its mode) | FOCE-I |
With additive error, \(V\) does not depend on \(\eta\) and the two coincide. With proportional error they can differ: in the illustration, \(V\) at the typical \(F(0)=(4.09,\,2.25,\,0.45)\) is \((0.670,\ 0.202,\ 0.0082)\), whereas at the mode it is \((0.751,\ 0.318,\ 0.0322)\); the 12-hour variance is almost four times larger once the subject's lower clearance is taken into account. Fixing it at the typical value makes that observation look four times more precise than it is.
Common mistakes
- Comparing the sums of \(c_{ij}\) across different error models as if they were goodness-of-fit measures. Only the full OFV, at the optimum of each model, can be compared (and then only for the same observations).
- Dropping the censored observations of an assay with a limit, which biases the late concentrations upward.
- Calling a fit with
INTERACTIONand one without "the same method".
Review checklist
- Can you derive \(V\) for the proportional and for the combined model from \(h\)?
- Do you know what a below-LLOQ record contributes under M3, and why it is not \(\log V+e^2/V\)?
- Do you know when the interaction option matters, and when it does not?
Navigation
See the previous page, the next page and the mathematical reference.