Tutorials › Optimal Design and Model-Informed Dosing › Analytical Validation of Model Predictions

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

Analytical Validation of Model Predictions

Learn to prespecify and interpret prediction metrics and plots so analytical performance is judged in the units and clinical context that matter.

Advanced 11 min read

What You'll Learn

  • Define a prediction error consistently and calculate bias, MAE, RMSE, and error spread.
  • Match performance metrics to the prediction target, time horizon, and clinical decision.
  • Read observed-versus-predicted and error plots without treating them as proof of validity.
  • Recognize how outliers, repeated measurements, and averaging choices affect summaries.
  • Distinguish descriptive analytical validation from external validation and later diagnostic work.

What Analytical Validation Evaluates

Analytical validation asks whether a specified model-and-prediction procedure produces predictions that agree sufficiently with observed clinical data for its intended use. It is not enough to report that predictions are “close.” The prediction target, prediction time, available inputs, evaluation population, and clinically important errors must be stated before results are examined. A model intended to predict a concentration before a dose decision, for example, should be evaluated against observations relevant to that prediction task—not against a different outcome selected after seeing the results.

The model should generate predictions for a validation data set without using the corresponding observed outcomes to fit or adjust those predictions. The observations and predictions must refer to the same target, time point, and units. The observed values are treated as the comparison reference, although measurement error in clinical observations can also contribute to discrepancies. Analytical validation therefore evaluates the complete prediction procedure under its specified conditions; it does not establish that the model will perform equally well at another site or in a later period.

Definition: For paired case \(i\), let \(y_i\) be the observed clinical value and \(\hat{y}_i\) the model prediction for the same target and time. Define prediction error as \(e_i=\hat{y}_i-y_i\). Thus, positive errors indicate overprediction and negative errors indicate underprediction. State this sign convention whenever reporting error summaries.

A defensible evaluation prespecifies the intended prediction (such as an individual concentration or dose-related quantity), the eligible cases, the relevant prediction horizon, the primary performance metric, any clinically justified tolerance, and the plots to be reviewed. The validation data should be collected and processed in a way consistent with the intended use. A favorable average metric cannot compensate for a mismatch between the validation task and the clinical task.

Metrics: Bias, Magnitude, and Spread

No single metric captures every aspect of predictive performance. Signed errors summarize direction; absolute and squared errors summarize magnitude; and tolerance-based summaries answer whether errors are small enough for a stated purpose. Metrics should be reported in context and with units.

Definitions: For \(n\) paired predictions and observations, mean prediction error (MPE) is the average signed error and summarizes bias. Mean absolute error (MAE) is the average absolute discrepancy. Root mean squared error (RMSE) gives greater weight to large errors because errors are squared before averaging. The sample standard deviation of errors summarizes their spread around the MPE.
$$ \mathrm{MPE}=\frac{1}{n}\sum_{i=1}^{n}e_i,\qquad \mathrm{MAE}=\frac{1}{n}\sum_{i=1}^{n}|e_i|,\qquad \mathrm{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}e_i^2} $$

MPE near zero does not mean that individual predictions are accurate: positive and negative errors may cancel. MAE is directly interpretable in the target’s units and is less dominated by a single large error than RMSE. RMSE is also in the target’s units, but a large discrepancy contributes disproportionately. The sample standard deviation \(s_e\) describes error spread around the observed MPE; it is not the same as RMSE.

$$ s_e=\sqrt{\frac{\sum_{i=1}^{n}(e_i-\bar{e})^2}{n-1}}, \qquad \bar{e}=\mathrm{MPE} $$

A useful check follows from the fact that the average squared error equals the squared mean error plus the average squared deviation from that mean. Taking square roots shows that RMSE cannot be smaller than the absolute MPE. Also, by the inequality between the quadratic and arithmetic means of nonnegative values, RMSE is at least as large as MAE. These relations are useful for checking calculations, not for deciding whether either metric is clinically acceptable.

$$ \mathrm{RMSE}^2=\bar{e}^{\,2}+\frac{1}{n}\sum_{i=1}^{n}(e_i-\bar{e})^2 \quad\Longrightarrow\quad \mathrm{RMSE}\geq |\mathrm{MPE}| \quad\text{and}\quad \mathrm{RMSE}\geq \mathrm{MAE} $$

When the clinical question concerns a meaningful error limit, also report the proportion of cases within a prespecified tolerance. The tolerance must be justified by the intended decision; it is not a universal property of the model. Relative errors can help compare performance across scales, but require care when observed values are near zero, and their interpretation depends on the denominator convention. Report the definition if they are used.

Worked Example: Calculating Bias and Error Magnitude

Suppose a hypothetical validation set contains five matched concentration predictions in mg/L. The observed values are 5, 7, 9, 11, and 13; the predictions are 6, 6, 10, 9, and 14. Assume the same concentration target and prediction time were used for every pair, and these cases were not used to fit or adjust the predictions.

Using \(e_i=\hat{y}_i-y_i\), the errors are \(1,-1,1,-2,1\) mg/L. Their sum is \(1-1+1-2+1=0\), so \(\mathrm{MPE}=0/5=0\) mg/L. This indicates no average signed bias in these five cases, but does not imply that every prediction is exact.

The absolute errors sum to \(1+1+1+2+1=6\) mg/L, giving \(\mathrm{MAE}=6/5=1.20\) mg/L. The squared errors sum to \(1+1+1+4+1=8\) \((\mathrm{mg/L})^2\), so \(\mathrm{RMSE}=\sqrt{8/5}=\sqrt{1.6}=1.265\) mg/L.

Because the error mean is zero, the sample standard deviation is \(s_e=\sqrt{8/(5-1)}=\sqrt{2}=1.414\) mg/L. RMSE exceeds MAE, as expected, and neither metric alone establishes acceptability. A clinical tolerance and the consequences of errors of this size would need to be specified for the intended use.

Plots and Clinically Relevant Summaries

Plots complement numerical summaries by showing features that an average can hide. An observed-versus-predicted plot places \(y_i\) on the horizontal axis and \(\hat{y}_i\) on the vertical axis, with the identity line \(\hat{y}=y\) as the reference for exact agreement. Points above that line are overpredictions under the error convention here; points below are underpredictions. The axes should have the same scale when visual distance from the identity line is being judged.

An error-versus-prediction plot places \(e_i\) against \(\hat{y}_i\), often with a horizontal reference at zero. A systematic slope, widening spread, clusters, or isolated extreme errors can signal that a single overall metric is not describing all cases adequately. These are prompts to investigate—not automatic proof of a particular cause. A histogram or other distribution plot of errors can reveal skewness or tails, while hiding which patients or prediction ranges produced those errors. Pair plots with summaries rather than substituting one for the other.

Worked Example: Using an Error Plot to Notice a Pattern

Consider four hypothetical concentration pairs, all in mg/L. Predictions are 2, 4, 8, and 12; the corresponding observations are 3, 5, 7, and 9. The errors \(\hat{y}_i-y_i\) are therefore \(-1,-1,1,3\) mg/L.

The MPE is \((-1-1+1+3)/4=2/4=0.500\) mg/L. The MAE is \((1+1+1+3)/4=6/4=1.50\) mg/L. The RMSE is \(\sqrt{(1+1+1+9)/4}=\sqrt{3}=1.732\) mg/L.

On an error-versus-prediction plot, the points are \((2,-1),(4,-1),(8,1),(12,3)\). In this small hypothetical set, errors become more positive as predictions increase, so higher predictions tend to overpredict relative to these observations. The plot makes that pattern visible even though the overall MPE is only 0.500 mg/L. Four points are far too few to establish that the pattern will persist; the appropriate conclusion is to examine the pattern in a suitably sized validation set and consider its clinical relevance.

A tolerance-based summary makes a different statement from MAE or RMSE. If the intended use has a clinically justified absolute-error tolerance \(\delta\), report the number and proportion of validation cases for which \(|e_i|\leq\delta\). If overprediction and underprediction have different consequences, symmetric absolute error may be insufficient: prespecified directional summaries or decision-specific consequences may be more informative. Do not choose a tolerance after inspecting errors simply to produce a favorable percentage.

Worked Example: Applying a Prespecified Error Tolerance

Suppose a hypothetical use case has a prespecified tolerance of 2 mg/L for absolute concentration error. Six observed-predicted pairs yield errors of \(1,-1,3,-2,0,-4\) mg/L. Assume the tolerance was justified before evaluation, and each pair represents the intended target and prediction time.

The absolute errors are \(1,1,3,2,0,4\), which sum to 11 mg/L. Thus, \(\mathrm{MAE}=11/6=1.833\) mg/L. The squared errors sum to \(1+1+9+4+0+16=31\) \((\mathrm{mg/L})^2\), giving \(\mathrm{RMSE}=\sqrt{31/6}=\sqrt{5.167}=2.273\) mg/L.

Four of the six errors have absolute value no greater than 2 mg/L: \(1,-1,-2,0\). The proportion within tolerance is \(4/6=0.667\), or 66.7%. This is a descriptive result for these hypothetical cases, not evidence that any future patient has a 66.7% probability of an acceptable prediction. The two larger errors, particularly the \(-4\) mg/L underprediction, should be considered in light of the clinical consequences and the prespecified acceptance criteria.

Prespecification, Dependence, and Failure Modes

The interpretation of a metric depends on how cases enter its calculation. With one prediction per patient, each patient contributes equally to an unweighted average. With repeated predictions for some patients, a pooled metric gives more weight to patients with more observations. That may be appropriate if the target is performance per prediction event, but not if the target is average performance per patient. State which estimand is intended. Repeated measurements within a patient are also correlated, so treating them as independent can make uncertainty estimates too optimistic. If uncertainty intervals are reported, their calculation should respect the sampling structure, for example by resampling patients rather than individual records when patients contribute multiple records.

Before interpreting results, check that each prediction is paired to the correct observation, that units and time points match, and that missing or excluded cases are described. Confirm that predictions were generated with only information available at the intended decision time; using later information can make performance appear better than it would be in practice. Examine the range and composition of evaluated cases, since a narrow or atypical set may not represent the intended application. A clean plot and a low average error cannot repair a mismatch in the prediction task or biased case inclusion.

Metric choice involves trade-offs. MPE is transparent about direction but permits cancellation. MAE is robust relative to RMSE but does not emphasize large errors as strongly. RMSE penalizes large errors more, which can be useful when large discrepancies are especially concerning, but one extreme observation may dominate it. A tolerance-based proportion is easy to relate to an acceptance rule but discards information about how far errors fall outside the tolerance. The observed-versus-predicted plot gives a direct view of agreement; error plots and distributions help reveal structures that an aggregate number may conceal.

  • Do not equate zero bias with good prediction. Opposing errors can average to zero while individual errors remain large.
  • Do not treat an acceptable average as universal acceptability. A metric can conceal large errors in a clinically important range or subgroup.
  • Do not use a post hoc threshold as an acceptance criterion. Define clinically meaningful tolerances before examining validation performance.
  • Do not interpret descriptive metrics as proof of causation or transportability. They describe agreement in the evaluated data and conditions.
Key takeaway: Analytical validation is strongest when the prediction task and acceptance criteria are specified in advance, the paired data genuinely represent that task, and numerical metrics are interpreted alongside plots and clinical consequences. Report bias, error magnitude, and relevant error patterns rather than relying on one favorable summary.

Check Your Understanding

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

  1. A model predicts 8 mg/L when the matched observation is 10 mg/L. Under the stated convention, what is the error, and does it represent overprediction or underprediction?
  2. Three hypothetical errors are \(2,-2,0\) mg/L. Calculate MPE, MAE, and RMSE. What does the MPE alone fail to show?
  3. Why can a pooled error metric give some patients more weight than others when each patient has a different number of records?
  4. What does a point above the identity line indicate on a plot with observed values on the horizontal axis and predictions on the vertical axis?

Solutions. 1. \(e=8-10=-2\) mg/L, an underprediction. 2. MPE is \((2-2+0)/3=0\) mg/L; MAE is \((2+2+0)/3=1.333\) mg/L; RMSE is \(\sqrt{(4+4+0)/3}=\sqrt{2.667}=1.633\) mg/L. Zero MPE does not show the nonzero individual errors. 3. Each record contributes one term to the pooled calculation, so a patient with more records contributes more terms and hence more weight. 4. The prediction exceeds the observation, so the point represents overprediction.

Clinical Biostats