Tutorials › Optimal Design and Model-Informed Dosing › Interpreting Prediction Error Patterns

Model-Informed Precision Dosing in Practice · Tutorial 391 of 497

Interpreting Prediction Error Patterns

Learn how to organize prediction-error summaries so that overall performance does not conceal where a dosing model is underperforming.

Advanced 12 min read

What You'll Learn

  • Define signed prediction error and distinguish it from a fitted residual.
  • Compare mean signed error with absolute-error and dispersion summaries.
  • Stratify errors by concentration, dosing history, and measurement conditions.
  • Detect subgroup patterns that disappear in an overall average.
  • Recognize data, sampling, and dependence problems that can mislead interpretation.
  • Use a structured diagnostic sequence to describe patterns without overclaiming their cause.

Why Prediction-Error Patterns Matter

An overall prediction-error summary can look acceptable while a model consistently misses in a clinically important part of its intended use. For example, errors may be small at low concentrations but show systematic underprediction at high concentrations. Or average error may be near zero because positive and negative errors cancel, even though predictions are poor under a particular dosing history or measurement condition. Interpreting the pattern of errors helps locate such failures and guides what to investigate next.

The goal is not to infer a cause from a plot alone. A pattern can signal a model limitation, a data-processing problem, a mismatch between prediction time and sample time, or differences in measurement conditions. The first task is to describe where errors occur, in what direction, and with what magnitude. The earlier material on calibration problems addresses calibration assessment; here the emphasis is on reading error summaries across clinically relevant subsets without letting an aggregate obscure them.

Definition: For record \(i\), let \(C_i\) be the observed concentration and \(\hat{C}_i\) the corresponding model prediction for the same target and time. Define the signed prediction error as \(e_i=C_i-\hat{C}_i\). Thus \(e_i>0\) means the prediction is below the observation (underprediction), while \(e_i<0\) means the prediction is above the observation (overprediction). Both \(C_i\) and \(\hat{C}_i\) must use the same concentration units.

A residual is often defined as observed minus fitted value, so its sign convention may match this one. The distinction is about how the prediction was obtained: a residual commonly describes a value used to fit the model, whereas a prediction error should be calculated for a prediction evaluated against an observation not used to produce that prediction, such as a held-out or prospective record. In either case, state the convention explicitly. Error patterns from fitted records can appear overly favorable because the same data helped estimate the model.

Summaries That Answer Different Questions

The mean signed error in a group of \(n\) records describes average direction and magnitude of bias on the original concentration scale. The mean absolute error (MAE) describes average error magnitude without allowing positive and negative errors to cancel. The root mean squared error (RMSE) also penalizes large errors more heavily. These summaries are complementary, not interchangeable.

$$ \text{Mean signed error}=\frac{1}{n}\sum_{i=1}^{n}e_i,\qquad \text{MAE}=\frac{1}{n}\sum_{i=1}^{n}|e_i|,\qquad \text{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}e_i^2}. $$

All three summaries have concentration units. A signed mean near zero does not establish that predictions are accurate: positive and negative errors can cancel. Conversely, a positive mean describes average underprediction under the stated convention; it does not imply that every record is underpredicted. A spread summary, such as the sample standard deviation \(s\) of signed errors, or a display of the individual errors, adds information about variability within a group.

Patterns are often examined by plotting signed errors against predicted concentration, observed concentration, time, dose, or a relevant measurement variable. Grouped summaries can then quantify a visible pattern. Use both where possible: plots reveal shapes, outliers, and transitions, while summaries make comparisons more concise. Stratification should be clinically motivated and specified with care; choosing cut points after inspecting many possible groupings can make an apparent pattern unstable.

Worked Example: A Concentration-Range Pattern Hidden by a Single Average

Consider eight hypothetical, independently evaluated concentration predictions, all in mg/L. Define error as observed minus predicted.

RangeObserved \(C_i\) (mg/L)Predicted \(\hat{C}_i\) (mg/L)Error \(e_i\) (mg/L)
Lower871
Lower910-1
Lower11110
Lower12120
Higher38335
Higher42357
Higher45414
Higher50428

In the lower range, the signed errors sum to \(1-1+0+0=0\), giving mean signed error \(0/4=0\) mg/L. Their absolute values sum to \(1+1+0+0=2\), so the MAE is \(2/4=0.5\) mg/L. In the higher range, the errors sum to \(5+7+4+8=24\), giving mean signed error \(24/4=6\) mg/L; the MAE is also \(24/4=6\) mg/L because all four errors are positive.

Across all eight records, the signed-error sum is \(0+24=24\) mg/L, so the overall mean signed error is \(24/8=3\) mg/L. The absolute-error sum is \(2+24=26\) mg/L, so the overall MAE is \(26/8=3.25\) mg/L. The overall signed mean alone compresses two very different patterns into one number. The subgroup results show little average signed error in the lower range and consistent underprediction in the higher range. These hypothetical data suggest a localized pattern to investigate; they do not establish why it occurred.

Reading Patterns Across Dosing Histories

A prediction depends on the information available when it is generated. A recent dose change, a missed dose, an uncertain administration time, or a record that does not reflect the actual dosing history may be relevant to its error. When comparing histories, verify that the prediction and observed concentration are aligned to the same intended time and that the history labels are defined consistently. Otherwise, the group comparison may mix genuine differences in model performance with timing or data-recording errors.

Stratifying by history is informative when the groups have enough observations to support a meaningful summary and when the groups are comparable for the question being asked. If a particular history occurs only at high concentrations, for example, a history-associated pattern could instead reflect concentration range, or both factors could contribute. Examine the underlying values and relevant variables rather than treating a subgroup mean as an isolated explanation.

Worked Example: Errors After a Recent Dose Change

Suppose eight hypothetical predictions are grouped by whether the dose was stable or had recently changed. Errors are observed minus predicted, in mg/L. Assume the records use the same prediction target and time definition in both groups.

For the stable-dose group, errors are \(1,-1,0,0\). The mean signed error is \((1-1+0+0)/4=0\) mg/L, and the MAE is \((1+1+0+0)/4=0.5\) mg/L.

For the recent-change group, errors are \(-5,-4,-6,-5\). Their sum is \(-20\) mg/L, so mean signed error is \(-20/4=-5\) mg/L. Their absolute values sum to \(20\) mg/L, so MAE is \(20/4=5\) mg/L. Under the stated sign convention, this group shows average overprediction, with much larger average error magnitude than the stable group.

The result warrants checking how dose-change timing and administration data were represented and whether predictions were made using information available at the intended prediction time. It does not by itself show that the recent dose change caused the errors or that the model’s dose-history component is the sole problem. The number of records is small, and other differences between the groups could account for some or all of the contrast.

Measurement Conditions and Error Dispersion

A group can have low average signed error but high variability. Differences in assay, sampling time, sample handling, or measurement precision may matter when those conditions differ across records. A mean signed error describes direction on average, not how tightly individual predictions agree with observations. Compare signed errors with absolute errors or a spread measure, and inspect the individual values for unusual observations.

Measurement noise is part of the observed prediction error: the observation is not necessarily the unknown true concentration. A pattern that appears only under one measurement condition may therefore reflect measurement characteristics, a timing mismatch, or a model limitation. Confirm that units, sample identifiers, assay conventions, and timing fields are consistent before interpreting it as model behavior.

Worked Example: Similar Signed Means, Different Error Spread

Two hypothetical measurement conditions each have four prediction errors in mg/L. Assume observations and predictions are matched to the same target, and the errors are \(e_i=C_i-\hat{C}_i\).

Under condition A, the errors are \(1,-1,0,2\). Their sum is \(2\), so the mean signed error is \(2/4=0.5\) mg/L. The absolute values sum to \(1+1+0+2=4\), giving MAE \(4/4=1\) mg/L. The sample standard deviation is \(s=\sqrt{5/3}=1.291\) mg/L: the squared deviations from the mean \(0.5\) are \(0.25,2.25,0.25,2.25\), which sum to \(5\).

Under condition B, the errors are \(5,-5,4,-4\). Their sum is zero, so the mean signed error is \(0/4=0\) mg/L. But the absolute values sum to \(18\), giving MAE \(18/4=4.5\) mg/L. Their squared deviations from the mean sum to \(25+25+16+16=82\), so the sample standard deviation is \(s=\sqrt{82/3}=5.228\) mg/L.

The signed means, \(0.5\) and \(0\) mg/L, are close, but condition B has substantially larger error magnitude and spread in this small example. Its positive and negative errors cancel in the signed mean. This is a reason to pair direction summaries with magnitude and dispersion summaries, not a basis for concluding that the measurement condition caused the difference.

A Practical Interpretation Sequence

A defensible reading of prediction-error patterns begins with data alignment and proceeds from broad summaries to specific subsets. The following sequence keeps the interpretation tied to what the records support.

1
Confirm the comparison.
Check that each prediction and observation refer to the same patient record, concentration unit, target, and time. State whether errors come from held-out or prospective predictions rather than fitted records.
2
Describe overall direction and magnitude.
Report signed error alongside MAE or RMSE, with the number of records and units. Do not interpret a signed mean near zero as evidence of small individual errors.
3
Inspect clinically motivated patterns.
Examine errors by concentration range, dosing history, and measurement condition. Use plots and group summaries to identify direction, magnitude, spread, outliers, and possible transitions.
4
Check whether the pattern is interpretable.
Review group sizes, data quality, and overlap in relevant characteristics. Treat sparse or highly imbalanced groups cautiously, and avoid turning a descriptive association into a causal claim.

Deriving the Pooled Mean and Recognizing Cancellation

The overall mean signed error is a size-weighted average of subgroup means. If records are partitioned into groups \(g=1,\ldots,G\), with \(n_g\) records and subgroup mean \(\bar{e}_g\), then \(\sum_g n_g=N\), where \(N\) is the total number of records. Since each subgroup mean is \(\bar{e}_g=(1/n_g)\sum_{i\in g}e_i\), the overall mean is

$$ \bar{e} =\frac{1}{N}\sum_{g=1}^{G}\sum_{i\in g}e_i =\frac{1}{N}\sum_{g=1}^{G}n_g\bar{e}_g. $$

This identity explains why subgroup means must be weighted by group size and why an overall mean can conceal opposing patterns. For example, if two equally sized groups have means \(+5\) and \(-5\) mg/L, the pooled mean is \((5+(-5))/2=0\) mg/L even though neither group has zero mean error. If group sizes differ, the larger group contributes more to the pooled result. The MAE does not cancel errors of opposite sign, but an overall MAE can still hide which subgroup contributes most of the error.

Assumptions, Diagnostics, and Common Pitfalls

Descriptive summaries do not require errors to be normally distributed. Their interpretation does require valid pairings, a consistent sign convention, common units, and a clear definition of the evaluation records. A subgroup comparison is most useful when the subgroup variable is measured reliably and the group sizes are reported. If several records come from the same patient, those errors may be correlated; counting every record as independent can overstate how much independent information is present. For descriptive reporting, show the record counts and, where relevant, the number of patients. Formal uncertainty calculations would need to account for clustering and the evaluation design.

Diagnostic signs of trouble include errors that change direction across a concentration range, a subgroup with much higher MAE or spread, isolated extreme errors, and apparent patterns that disappear after correcting timing or unit inconsistencies. A single outlier should be checked against source data, but should not be removed simply because it is inconvenient. When records are sparse, show the individual errors and avoid confident generalization from a subgroup average. When many possible stratifications are examined, label exploratory findings as such and seek confirmation in additional appropriate data.

  • Mistake: “The overall mean error is nearly zero, so predictions are accurate.” Positive and negative errors can cancel. Compare MAE or RMSE and inspect subgroup patterns.
  • Mistake: “A positive error means the model overpredicts.” With \(e_i=C_i-\hat{C}_i\), a positive error means the prediction is below the observation: underprediction.
  • Mistake: “A subgroup difference proves the subgroup characteristic caused the error.” The difference is descriptive; other characteristics, measurement conditions, or data problems may explain it.
  • Mistake: “Every row is an independent evaluation.” Repeated records from one patient can be related. Report the structure and account for it when making inferential claims.

No single summary is universally best. The signed mean is useful for average direction; MAE gives an interpretable average magnitude; RMSE emphasizes large errors; and plots show how errors vary across the predictor or clinical context. These approaches answer different questions and should generally be combined. Error-pattern analysis is limited by the quality and representativeness of the evaluation records, measurement uncertainty, sparse subgroups, and the possibility that several factors change together. Its strongest conclusion is often a precise description of where performance differs and what should be checked next—not a causal diagnosis.

Key takeaway: Report prediction errors with an explicit sign convention, examine direction and magnitude together, and stratify by relevant concentration, dosing-history, and measurement conditions. A pooled average is a summary of the records, not a guarantee of consistent performance across them.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. With \(e_i=C_i-\hat{C}_i\), what does a mean signed error of \(-2\) mg/L indicate?
  2. Two equally sized groups have mean signed errors of \(+4\) and \(-4\) mg/L. What is the pooled mean, and why could it be misleading?
  3. Four errors are \(2,-2,1,-1\) mg/L. Calculate the mean signed error and MAE.
  4. A group defined by recent dose change has larger errors than a stable-dose group. Name two checks needed before attributing the pattern to model performance.

Solutions. (1) On average, predictions are 2 mg/L above observations, so the model overpredicts by 2 mg/L under this convention. (2) The pooled mean is \((4+(-4))/2=0\) mg/L because the groups are equally sized. It is misleading as a standalone accuracy summary because it hides the opposing group patterns; magnitudes and subgroup summaries are also needed. (3) The signed sum is \(2-2+1-1=0\), so mean signed error is \(0/4=0\) mg/L. The absolute values sum to \(2+2+1+1=6\), so MAE is \(6/4=1.5\) mg/L. (4) Check that prediction and observation times, dose histories, and units are aligned and correctly recorded; also compare group sizes and relevant differences such as concentration range or measurement condition. These checks help distinguish a descriptive association from a supported explanation.

Clinical Biostats