What a Prediction Error Measures
In external validation, a prediction error compares a model prediction with the corresponding observed concentration in data not used to estimate or update the locked model. The arithmetic is simple, but the result depends on two choices that must be stated: which prediction is being evaluated and what counts as one unit of evaluation. A prediction for each concentration record and a summary that gives each participant equal weight answer different questions when participants contribute different numbers of records.
Let \(C_{ij}\) be the observed concentration for participant \(i\) at record \(j\), and let \(\widehat{C}_{ij}\) be its corresponding prediction. Use the same concentration units for both quantities. This tutorial defines error as prediction minus observation, so positive error means overprediction. Some reports use the opposite sign; stating the convention is essential when comparing results.
If there are \(N\) evaluated records, with one prediction paired to each observation, the record-level metrics are
ME, MAE, and RMSE have the same concentration units as the observations; MSE has squared concentration units. ME summarizes signed average error, so positive and negative errors can cancel. MAE summarizes the typical absolute discrepancy in concentration units. MSE and RMSE give relatively greater influence to large errors because squaring grows faster than taking an absolute value.
The Prediction and Evaluation Units
A prediction must be identified before calculating its error. Population predictions use the locked population model and the available design information without estimating a participant-specific random effect from that participant's observed concentrations. Conditional predictions incorporate participant-specific information, commonly through an estimated individual effect. The two prediction types answer different predictive questions; their errors should be labelled and not treated as interchangeable evidence about the same task.
The earlier material on Population and Conditional Prediction Performance distinguishes those targets. Here, the key requirement is to keep the chosen prediction vector fixed while calculating its metrics. For example, an error calculated from a population prediction cannot be described as the error of a conditional prediction simply because both refer to the same observed concentration.
The evaluation unit also matters. A pooled record-level metric gives every concentration record equal weight. If one participant contributes many more records than another, that participant contributes more terms to the sum. An equal-participant summary instead first calculates a summary within each participant and then averages those participant summaries. Neither is automatically correct in all settings: the appropriate choice depends on whether the target is a typical evaluated record or a typical participant.
Worked Example: Calculating Record-Level Errors
Suppose, hypothetically, an external validation set contains four observed concentrations of 10, 5, 2, and 1 mg/L. The corresponding locked-model predictions are 12, 4, 3, and 0.5 mg/L. Calculate the signed errors and the four metrics, treating each record equally.
Using \(e_k=\widehat{C}_k-C_k\), the errors are \(12-10=2\), \(4-5=-1\), \(3-2=1\), and \(0.5-1=-0.5\) mg/L. Thus \(N=4\).
Mean error: \(\mathrm{ME}=(2-1+1-0.5)/4=1.5/4=0.375\) mg/L. The positive value indicates average overprediction across these four records, although two records were underpredicted.
Mean absolute error: \(\mathrm{MAE}=(2+1+1+0.5)/4=4.5/4=1.125\) mg/L.
Mean squared error and root mean squared error: \(\mathrm{MSE}=(2^2+(-1)^2+1^2+(-0.5)^2)/4=(4+1+1+0.25)/4=1.5625\) (mg/L)\(^2\). Therefore, \(\mathrm{RMSE}=\sqrt{1.5625}=1.25\) mg/L.
These values describe this specific set of four prediction-observation pairs. The ME is smaller than the MAE because signed errors partly cancel; it does not mean that the predictions are all within 0.375 mg/L of the observations.
Why Signed and Unsigned Metrics Differ
Signed errors retain direction. For example, equal errors of \(+3\) and \(-3\) mg/L have an ME of zero, even though neither prediction is exact. Absolute and squared errors do not cancel in this way: in that example MAE is 3 mg/L and MSE is 9 (mg/L)\(^2\). For this reason, ME alone is not a measure of overall error magnitude.
The relationship between MSE, signed bias, and dispersion follows from a simple decomposition. Treat the \(N\) observed errors as a fixed set, define their mean as \(\bar{e}\), and define their variance with divisor \(N\) as \(v_e=N^{-1}\sum_{k=1}^{N}(e_k-\bar{e})^2\). Since \(e_k=(e_k-\bar{e})+\bar{e}\), expand the square and sum:
The middle term is zero because the deviations from their arithmetic mean sum to zero. This identity shows why squared error reflects both the spread of errors around their mean and the magnitude of the mean error. It uses the error variance with divisor \(N\); substituting a sample variance with divisor \(N-1\) would require adjusting the identity.
Worked Example: Pooled Records Versus Equal Participant Weighting
Consider a hypothetical external data set with two participants. Participant A has three records with errors \(+2,+2,+2\) mg/L; participant B has one record with error \(-4\) mg/L. Compare pooled record-level summaries with summaries that give each participant equal weight.
Pooled record-level ME: \((2+2+2-4)/4=2/4=0.5\) mg/L. The three records from A count three times, while B's single record counts once.
Equal-participant signed summary: A's mean error is \((2+2+2)/3=2\) mg/L, and B's is \(-4\) mg/L. Averaging these two participant means gives \((2-4)/2=-1\) mg/L. This differs in both value and sign from the pooled ME because the two summaries use different weighting.
Pooled record-level MAE: \((2+2+2+4)/4=10/4=2.5\) mg/L. To give each participant equal weight while retaining each participant's average absolute discrepancy, calculate A's mean absolute error as 2 mg/L and B's as 4 mg/L, then average: \((2+4)/2=3\) mg/L.
The pooled figures describe the average record under the observed sampling pattern. The equal-participant figures describe an average of participant-level summaries for these two participants. A report should name which target it uses rather than presenting one weighting as universally preferable.
Metrics for Different Prediction Targets
A performance metric is conditional on the predictions used to create its errors. If population predictions and conditional predictions are both of interest, calculate and report their metrics separately, using matched observations and an explicitly stated evaluation unit. Conditional predictions can use information from a participant's concentration data, so lower conditional error does not by itself show that population predictions will perform better in a new participant or external setting.
Worked Example: Comparing Two Prediction Vectors
For three hypothetical observed concentrations of 8, 4, and 2 mg/L, suppose population predictions are 6, 5, and 1 mg/L. Suppose conditional predictions, which use participant-specific information, are 7, 4.5, and 1.5 mg/L. Calculate metrics separately for each vector using the three records equally.
For population predictions, the errors are \(6-8=-2\), \(5-4=1\), and \(1-2=-1\) mg/L. Thus \(\mathrm{ME}=(-2+1-1)/3=-2/3\approx-0.667\) mg/L, \(\mathrm{MAE}=(2+1+1)/3=1.333\) mg/L, and \(\mathrm{MSE}=(4+1+1)/3=2.000\) (mg/L)\(^2\). The RMSE is \(\sqrt{2}=1.414\) mg/L.
For conditional predictions, the errors are \(7-8=-1\), \(4.5-4=0.5\), and \(1.5-2=-0.5\) mg/L. Therefore, \(\mathrm{ME}=(-1+0.5-0.5)/3=-1/3\approx-0.333\) mg/L, \(\mathrm{MAE}=(1+0.5+0.5)/3=0.667\) mg/L, and \(\mathrm{MSE}=(1+0.25+0.25)/3=0.500\) (mg/L)\(^2\). The RMSE is \(\sqrt{0.500}=0.7071\) mg/L.
The conditional prediction errors are smaller for all three magnitude summaries in this small example. That is a comparison of these two prediction procedures on these records, not a like-for-like claim about prediction for a new participant: the conditional predictions used participant-specific information.
Assumptions, Checks, and Limitations
These descriptive calculations require no normality assumption. They do require correctly matched observations and predictions, a consistent concentration scale and unit, and a defined evaluation set. Every included pair must refer to the same participant, sampling occasion, analyte, and intended prediction target. The model and its predictions should also correspond to the external validation procedure being assessed, rather than predictions generated after using the validation observations to update the model.
Before interpreting a metric, check the following:
- Direction: confirm that error is prediction minus observation, so positive values mean overprediction.
- Pairing: verify that each prediction is matched to its actual observed concentration and record.
- Prediction type: label population or conditional predictions and state what participant-specific information was used.
- Weighting: report whether records are pooled or participant-level summaries receive equal weight.
- Units and scale: report concentration units for ME, MAE, and RMSE, and squared units for MSE.
A metric compresses many errors to one number and can conceal important features of the set. ME can be near zero when large positive and negative errors cancel. MAE and RMSE do not show whether errors tend to overpredict or underpredict. RMSE is particularly sensitive to a small number of large errors; that sensitivity can be informative when large misses matter, but it can also make the summary unstable in a small external sample. MSE is even less immediately interpretable because its units are squared.
All four metrics depend on the concentration scale. Errors of 1 mg/L have a different practical meaning at low and high concentrations, and an absolute-error metric does not adjust for that difference. Relative or logarithmic errors define different summaries and require their own choices and assumptions; they should not be substituted silently for absolute concentration errors, especially when concentrations are zero or close to zero. A performance summary also does not describe prediction-interval coverage or establish how observed concentrations relate to predictions across their range.
There is no universally best single metric. A clear external validation report usually gives a signed summary alongside at least one magnitude summary, identifies the prediction type and evaluation unit, and explains why that target is relevant. Comparing models using one metric is meaningful only when the observations, prediction target, inclusion rules, and weighting are comparable.
Common Mistake: Treating a Small Mean Error as Accurate Prediction
A common but incorrect argument is: “The ME is close to zero, so predictions are accurate.” A near-zero ME establishes only that average signed errors are small in the chosen aggregation. It does not rule out large errors in both directions. For example, errors of \(+5\) and \(-5\) mg/L have ME \(=(5-5)/2=0\) mg/L but MAE \(=(5+5)/2=5\) mg/L. The correction is to report signed direction and error magnitude separately, and to state the unit and weighting for each.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Under the convention \(e=\widehat{C}-C\), an observed concentration is 6 mg/L and its prediction is 4 mg/L. What is the signed error, and does it indicate overprediction or underprediction?
- Two errors are \(+3\) and \(-3\) mg/L. Calculate ME and MAE. What does their difference illustrate?
- One participant contributes five records and another contributes one. Which participant has more influence on a pooled record-level mean error? What alternative gives their participant-level mean errors equal weight?
- Why should lower error from conditional predictions not automatically be interpreted as better prediction for a new participant?
Solutions. (1) \(e=4-6=-2\) mg/L, indicating underprediction. (2) \(\mathrm{ME}=(3-3)/2=0\) mg/L and \(\mathrm{MAE}=(3+3)/2=3\) mg/L; signed cancellation can hide substantial absolute error. (3) The participant with five records has more influence because five of the six terms come from that participant. Calculate each participant's mean error first, then average those two means to give the participants equal weight. (4) Conditional predictions use participant-specific information, whereas prediction for a new participant cannot generally use that person's observed concentrations in the same way; the two metrics evaluate different prediction tasks.