Tutorials › Regression Analysis (Undergraduate) › Why Opposing Errors Can Cancel

Prediction Metrics and Calibration · Tutorial 774 of 991

Why Opposing Errors Can Cancel

Learn how signed prediction errors cancel in the mean, and why mean absolute error is needed to describe the typical size of those errors.

Intermediate 9 min read

What You'll Learn

  • Define prediction error using a consistent observed-minus-predicted sign convention.
  • Calculate mean prediction error and mean absolute error from the same cases.
  • Explain how positive and negative errors can cancel in a signed average.
  • Use the relationship between mean prediction error and mean absolute error to interpret both metrics.
  • Recognize why a near-zero mean prediction error does not establish accurate individual predictions.

Introduction

A prediction system can overpredict for some cases and underpredict for others. When the signed errors are averaged, those opposite directions can offset one another. As a result, the average can be close to zero even if the system's predictions are substantially wrong case by case.

The mean prediction error describes the average direction of errors under a chosen sign convention. Mean absolute error (MAE), by contrast, describes their average size without allowing positive and negative errors to cancel. Reading the two together helps distinguish little overall signed error from close predictions for individual cases.

Signed Errors and Their Mean

For each case, pair its observed outcome with the prediction made for that same case. Use one consistent convention throughout: prediction error is the observed outcome minus the predicted outcome. A positive error means the prediction was too low; a negative error means it was too high. The errors and both summary measures must use the same outcome units.

Definition: For case \(i\), let \(y_i\) be the observed outcome and \(\hat{y}_i\) its prediction. The prediction error is \(e_i=y_i-\hat{y}_i\). For \(n\) paired cases, the mean prediction error is \(\mathrm{MPE}=\frac{1}{n}\sum_{i=1}^{n}e_i\), and the mean absolute error is \(\mathrm{MAE}=\frac{1}{n}\sum_{i=1}^{n}|e_i|\). MPE retains each error's sign; MAE takes its absolute value before averaging.

These are descriptive summaries of the cases included in the calculation. They require matched observed outcomes and predictions on a common scale, and the formulas above give every case equal weight. No independence assumption is needed just to calculate these summaries. If cases are missing, be clear about which paired cases are included; comparing metrics computed on different sets can be misleading.

With this sign convention, positive MPE indicates average underprediction, while negative MPE indicates average overprediction. MPE is sometimes used as an estimate of systematic bias on the evaluated cases, but it is still an average: it does not show the size or pattern of every case's error. MAE is nonnegative and is expressed in the same units as the outcome.

Worked Example: Exact Cancellation With Large Case-Level Errors

Suppose, hypothetically, a delivery service predicts the time needed for four deliveries. Times are measured in minutes. For each case, calculate the error as observed time minus predicted time.

DeliveryObserved time (minutes)Predicted time (minutes)Error (minutes)Absolute error (minutes)
150381212
24254-1212
3655788
43038-88

The positive errors sum to \(12+8=20\) minutes, and the negative errors sum to \(-12-8=-20\) minutes. Thus the signed sum is zero, giving

$$ \mathrm{MPE}=\frac{12+(-12)+8+(-8)}{4} =\frac{0}{4}=0\text{ minutes}. $$

The absolute errors instead sum to \(12+12+8+8=40\) minutes, so

$$ \mathrm{MAE}=\frac{12+12+8+8}{4} =\frac{40}{4}=10\text{ minutes}. $$

The MPE says that the positive and negative errors balance on average for these four deliveries. It does not say the predictions were close: every prediction missed by at least 8 minutes, and the average absolute miss was 10 minutes.

Why the Signed Average Can Mislead

The reason for cancellation is arithmetic. A signed average combines positive and negative quantities before dividing by the number of cases. If the positive errors add to about the same amount as the magnitudes of the negative errors, the total is small. MAE changes the calculation order: it removes the signs first, so every case contributes a nonnegative amount.

Result: For any set of paired predictions and outcomes, \(|\mathrm{MPE}|\leq \mathrm{MAE}\). A small absolute MPE can occur alongside a much larger MAE because the former reflects the net signed total, while the latter reflects the total magnitude of error.

To verify the result, apply the triangle inequality to the sum of errors:

$$ |\mathrm{MPE}| =\left|\frac{1}{n}\sum_{i=1}^{n}e_i\right| =\frac{1}{n}\left|\sum_{i=1}^{n}e_i\right| \leq \frac{1}{n}\sum_{i=1}^{n}|e_i| =\mathrm{MAE}. $$

The inequality says that the net signed error cannot have a greater magnitude than the sum of the individual error magnitudes. It does not say that MPE is usually a good substitute for MAE. When errors point in opposing directions, the inequality can be very far from equality. If every error has the same sign, then \(|\mathrm{MPE}|=\mathrm{MAE}\); if signs oppose one another, cancellation can make \(|\mathrm{MPE}|\) much smaller.

Worked Example: A Near-Zero Mean With Noticeable Errors

Imagine a hypothetical set of five forecasts of a machine's operating time, recorded in hours. The observed-minus-predicted errors are \(12,-11,9,-10,\) and \(1\) hours. These errors could arise, for example, from observed and predicted pairs \((52,40)\), \((41,52)\), \((68,59)\), \((37,47)\), and \((55,54)\), respectively.

The signed sum is \(12-11+9-10+1=1\) hour. Therefore,

$$ \mathrm{MPE}=\frac{1}{5}=\;0.2\text{ hours}. $$

For MAE, first take the absolute value of each error. The absolute errors sum to \(12+11+9+10+1=43\) hours, giving

$$ \mathrm{MAE}=\frac{43}{5}=8.6\text{ hours}. $$

The average signed error is only 0.2 hours, but the average absolute error is 8.6 hours. In context, these calculations say that overprediction and underprediction nearly balance in total, while a typical case still has a substantial absolute discrepancy as summarized by MAE.

“Typical” here describes an average of absolute errors, not a claim that every case misses by exactly the MAE. Some errors can be smaller and some larger. A metric also cannot by itself explain why errors differ; it only summarizes the chosen cases under its own rule.

Worked Example: Two Error Patterns With the Same Mean Prediction Error

Consider two hypothetical prediction methods for the same two observed delivery times: 80 minutes and 60 minutes. Method A predicts 70 minutes and 70 minutes, so its errors are \(80-70=10\) and \(60-70=-10\) minutes. Method B predicts 79 minutes and 61 minutes, so its errors are \(80-79=1\) and \(60-61=-1\) minute.

For Method A,

$$ \mathrm{MPE}_A=\frac{10+(-10)}{2}=0\text{ minutes}, \qquad \mathrm{MAE}_A=\frac{|10|+|-10|}{2}=10\text{ minutes}. $$

For Method B,

$$ \mathrm{MPE}_B=\frac{1+(-1)}{2}=0\text{ minutes}, \qquad \mathrm{MAE}_B=\frac{|1|+|-1|}{2}=1\text{ minute}. $$

Both methods have zero MPE because each underprediction is balanced by an overprediction of equal size. Their MAEs distinguish the patterns: Method B's predictions are much closer for these two cases. The shared MPE alone cannot make that comparison.

Using MPE and MAE Together

When reporting both metrics, give the direction and size of the MPE and the outcome units, then report MAE in those same units. For example, “MPE was 0.2 hours and MAE was 8.6 hours” makes two different statements: errors had a small net positive average, and their average absolute size was much larger. Avoid describing a small MPE as evidence that individual predictions are accurate.

The interpretation also depends on which cases were evaluated. A mean near zero on a particular test set summarizes that set; it does not guarantee that errors will cancel in another set or in future use. A few large positive errors can also offset a few large negative errors. Looking at the signed average alongside MAE prevents the direction-of-error summary from being mistaken for an error-size summary.

Common Mistake

  • Wrong reasoning: “The mean prediction error is nearly zero, so predictions were nearly correct.” This treats a signed average as though it summarized the size of each error.
  • Correction: Positive and negative errors may cancel. Calculate MAE as well: take the absolute value of each error before averaging. Then interpret MPE as the average direction and MAE as the average absolute size, both in context and in outcome units.
Key takeaway: A mean prediction error near zero means that positive and negative errors nearly balance in their signed total. It does not mean that case-level errors are small. Compare it with MAE to see how large the absolute errors are on average.

Check Your Understanding

Use observed-minus-predicted errors and answer each question.

  1. For errors \(6,-6,4,-4\) minutes, calculate MPE and MAE. What does each measure say?
  2. Can a data set have an MPE of zero and a positive MAE? Explain using the definitions.
  3. For errors \(3,3,3\) kilograms, calculate MPE and MAE. Why are their numerical values equal?
  4. A model has MPE \(-0.1\) hours and MAE \(5.2\) hours. State what the sign of MPE indicates and why it would be incorrect to call the predictions nearly exact.
  5. Why must predictions and observed outcomes be paired on the same cases when calculating these metrics?