Why MAPE Needs Care Near Zero
A percentage error sounds like a natural way to compare predictions when outcomes have different scales. But a percentage error uses the actual outcome as its denominator. When that outcome is zero, the percentage is undefined; when it is close to zero, even a modest absolute error can produce an enormous percentage. As a result, MAPE can be undefined or can give disproportionate influence to a few small actual values.
This matters whenever a predictive model is assessed on amounts that can be zero or small, such as hypothetical daily claim counts, transaction amounts, or service volumes. The issue is not fixed merely by reporting more decimal places. The metric itself needs to suit the data and the decision.
MAPE is an average of observation-level relative errors: each absolute error is divided by that observation’s actual magnitude before the terms are averaged. It does not measure the average absolute error in the outcome’s original units. In particular, the denominator means that equal absolute errors need not have equal influence.
Why a Small Denominator Can Dominate
The key calculation is in each term, not just in the final average. For the same absolute prediction error, a smaller actual value produces a larger percentage error. For example, an error of 1 when the actual value is 0.2 contributes \(1/0.2=5\), or 500%, while an error of 1 when the actual value is 20 contributes \(1/20=0.05\), or 5%.
This weighting effect follows directly from the definition. For nonzero outcomes, the sum inside MAPE can be rewritten as \(\sum_i (1/|y_i|)|y_i-\hat{y}_i|\). Thus, each absolute error is weighted by the reciprocal of its actual magnitude. As \(|y_i|\) approaches zero, that weight grows without bound; at zero, the ratio is not defined. This explains both the extreme values near zero and the undefined value at zero.
A useful alternative for many tasks is mean absolute error (MAE), which averages absolute errors without dividing by the actual outcomes. It remains defined when actuals are zero, and it is expressed in the same units as the outcome. The trade-off is that MAE does not express error as a percentage and can be dominated by large errors in high-magnitude observations. Metric choice should reflect what kinds of prediction errors matter for the decision.
Worked Example: Zero and Near-Zero Actuals
A hypothetical service team forecasts daily work volume for four days. Actual volumes are 0, 0.2, 20, and 40 units; the corresponding forecasts are 1, 1.2, 18, and 44 units. Determine whether MAPE is defined for all four days, calculate the nonzero-only MAPE for diagnosis, and calculate MAE for all days. State which measure is defensible if errors on every day matter in units.
Method. Calculate the absolute error for each day, then apply the metric definitions. This keeps the zero-denominator issue visible rather than silently assigning a value to it.
| Day | Actual | Forecast | Absolute error | Percentage error if defined |
|---|---|---|---|---|
| 1 | 0 | 1 | 1 | Undefined: denominator is 0 |
| 2 | 0.2 | 1.2 | 1 | \(1/0.2=5=500\%\) |
| 3 | 20 | 18 | 2 | \(2/20=0.1=10\%\) |
| 4 | 40 | 44 | 4 | \(4/40=0.1=10\%\) |
On day 1, ordinary MAPE is undefined. Therefore, MAPE over all four days is undefined. If we calculate a nonzero-only average as a diagnostic, the three defined percentage terms sum to \(500\%+10\%+10\%=520\%\). Their mean is \(520\%/3=173.333\ldots\%\), or 173.33% to two decimal places. This is not MAPE over the original four-day dataset; it is an average over the three days retained.
For MAE, the absolute errors across all four days sum to \(1+1+2+4=8\) units. Thus, \(\operatorname{MAE}=8/4=2\) units. The MAE calculation includes the zero-actual day without difficulty.
Decision and check. If the goal is to summarize typical absolute error per day in units, MAE is defensible: it includes every day and gives an interpretable result of 2 units. The nonzero-only percentage average is dominated by the 500% term from an actual of 0.2, and excluding day 1 changes which observations are represented. The error total checks: 8 units across four days gives 2 units per day.
Comparing Models: The Metric Can Change the Ranking
A metric is not a neutral label placed on a model after fitting. It specifies how prediction errors are summarized. If a small actual value receives very large weight under MAPE, two models can rank differently under MAPE and MAE. Neither ranking is automatically wrong: each answers a different question.
Worked Example: MAPE and MAE Prefer Different Forecasts
A hypothetical analyst compares two models on three observations with actual amounts of $0.50, $50, and $100. Model A predicts $1.50, $55, and $90. Model B predicts $0.60, $42, and $108. Calculate MAPE and MAE for each model, rounding percentages to two decimal places and dollar amounts to the nearest cent. Explain the difference in rankings.
Method. Find each absolute error first. For MAPE, divide each error by its corresponding actual and average the three percentages. For MAE, average the three dollar errors.
For Model A, the absolute errors are \(|0.50-1.50|=\$1.00\), \(|50-55|=\$5.00\), and \(|100-90|=\$10.00\). Its percentage errors are \(1/0.50=200\%\), \(5/50=10\%\), and \(10/100=10\%\). Therefore, \(\operatorname{MAPE}_A=(200\%+10\%+10\%)/3=73.33\%\). Its absolute errors sum to \(\$16.00\), so \(\operatorname{MAE}_A=\$16.00/3=\$5.33\) to the nearest cent.
For Model B, the absolute errors are \(|0.50-0.60|=\$0.10\), \(|50-42|=\$8.00\), and \(|100-108|=\$8.00\). Its percentage errors are \(0.10/0.50=20\%\), \(8/50=16\%\), and \(8/100=8\%\). Therefore, \(\operatorname{MAPE}_B=(20\%+16\%+8\%)/3=14.67\%\). The absolute errors sum to \(\$16.10\), so \(\operatorname{MAE}_B=\$16.10/3=\$5.37\) to the nearest cent.
Interpretation and check. MAPE favors Model B, while MAE favors Model A. Model B is much closer in percentage terms on the $0.50 observation, which has substantial influence on MAPE. Model A’s total absolute error is lower by $0.10, so its MAE is lower. The summed errors, $16.00 and $16.10, confirm the MAE calculations. A defensible choice depends on the decision: if dollar error per observation is the target, use MAE; do not select MAPE just because the result is expressed as a percentage.
Alternatives and Their Conditions
The simplest alternative when zero outcomes are present is often MAE, especially if a typical error in the outcome’s units is useful to decision-makers. When every observation matters equally, MAE includes zero actuals without a special rule. It does not, however, make small outcomes more important just because they are small.
Another possible summary is weighted absolute percentage error (WAPE), defined here when the sum of absolute actual values is positive. It divides the total absolute error by the total absolute actual amount. Unlike MAPE, it does not calculate a separate ratio for each observation, so an individual zero actual does not by itself make WAPE undefined. But WAPE gives greater aggregate influence to observations with larger actual amounts and can conceal poor performance on low-volume observations. If all actuals are zero, its denominator is zero too, so WAPE is undefined.
Worked Example: Choosing an Aggregate or Per-Observation Summary
A hypothetical dispatch desk records actual daily volumes of 0, 10, and 30 units, and forecasts 2, 8, and 36 units. Calculate MAE and WAPE, explain why MAPE is undefined for the full dataset, and choose a measure for a decision that treats each day as equally important.
Method. Calculate absolute errors first. MAE averages them across days; WAPE divides their sum by the sum of actual volumes.
The absolute errors are \(|0-2|=2\), \(|10-8|=2\), and \(|30-36|=6\) units. Their sum is \(2+2+6=10\). The actual-volume sum is \(0+10+30=40\). Thus, \(\operatorname{MAE}=10/3=3.333\ldots\) units, or 3.33 units to two decimal places, and \(\operatorname{WAPE}=100\%(10/40)=25\%\).
MAPE over all three days is undefined because its first term divides by zero. If the zero-actual day were dropped, the remaining percentage errors would be \(2/10=20\%\) and \(6/30=20\%\), averaging 20%. That number describes only the two retained days.
Decision and check. If each day matters equally and the decision concerns typical error per day, MAE is the clearer choice: it includes all three days and reports 3.33 units. If the concern is total error relative to total volume, WAPE may be more relevant, but its aggregate weighting answers a different question. The calculations check because the absolute-error total is 10 and the actual-volume total is 40, giving \(10/40=25\%\).
Common Traps and a Practical Decision Process
Two tempting repairs to MAPE can change the analysis without making the problem go away. First, dropping observations with zero actuals produces a metric for a selected subset, not for the original dataset. If zero outcomes are common or meaningful, excluding them can hide an important part of predictive performance. Second, replacing a zero denominator with a small constant \(\epsilon\) makes the calculation depend on a chosen value and the units of measurement. Unless that constant has a justified interpretation fixed by the application, the resulting percentage is an arbitrary modified metric, not ordinary MAPE.
Worked Example: The Zero-Replacement Trap
A reviewer evaluates a forecast with an actual outcome of 0 units and a predicted outcome of 2 units. The reviewer substitutes \(\epsilon=0.1\) in the denominator and reports \(2/0.1=20\), or 2,000%. Diagnose the calculation and give a sounder summary if the outcome is measured in units and the absolute error is decision-relevant.
Wrong calculation. The expression \(2/0.1=20\) is arithmetically correct, but it does not calculate ordinary MAPE. Ordinary MAPE’s term is \(2/0\), which is undefined. The substituted value has created a different measure.
Why the substitution is arbitrary. If the same outcome is recorded in tenths of a unit, the actual remains zero and the absolute error becomes 20 tenths. Keeping \(\epsilon=0.1\) in the new units would produce \(20/0.1=200\), or 20,000%, rather than 2,000%. The reported ratio changes with the unit convention and the chosen constant.
Correction. Report that MAPE is undefined for this observation. If the decision concerns absolute error, report the error as 2 units and use a summary such as MAE across the full evaluation set. That preserves the original outcome scale and does not pretend that a zero-denominator percentage exists. The check is direct: \(|0-2|=2\) units.
A practical evaluation can proceed in a few explicit steps:
Count zeros and examine how many values are close to zero relative to the measurement scale.
If any actual is zero, ordinary MAPE for the full dataset is undefined. If values are merely small, calculate the terms to see whether they dominate.
Use MAE when typical absolute error per observation in original units is meaningful. Consider WAPE when aggregate error relative to aggregate volume is the intended target and the total actual magnitude is positive.
If a subset or modified formula is reported, identify it explicitly; do not label it as ordinary MAPE over the full dataset.
The central exam-style distinction is between a metric being numerically computable and being appropriate for the question. MAPE is undefined at zero, and near zero it can give a small absolute error disproportionate influence. MAE avoids the zero denominator but answers a different question, while WAPE summarizes errors relative to total volume. State the metric, its conditions, the observations included, and the unit or interpretation of the result.
Check Your Understanding
For each problem, calculate the requested values and note what the metric can and cannot summarize.
- A hypothetical device records actual daily readings of 0, 4, and 8 units, with predictions of 2, 2, and 10 units. Is MAPE defined over all days? Calculate MAE. (Answer: MAPE is undefined; MAE is 2 units.)
- Actual amounts are $0.25 and $25, and forecasts are $0.75 and $20. Calculate MAE and the average of the two defined percentage errors. Why is that average not MAPE for a dataset that also includes an additional zero-actual observation? (Answer: MAE is $2.75; the two percentage errors are 200% and 20%, averaging 110%; with the additional zero actual, full-dataset MAPE is undefined.)
- Actual values are 10, 20, and 30 units; predictions are 8, 24, and 33 units. Calculate MAE and MAPE, rounding MAPE to two decimal places. (Answer: MAE is 3 units; MAPE is \((20\%+20\%+10\%)/3=16.67\%\).)
- Actual amounts are $1 and $100. Model A predicts $2 and $110; Model B predicts $1.50 and $104. Calculate each model’s MAE and MAPE, and identify which model each metric favors. (Answer: Model A has MAE $5.50 and MAPE 55%; Model B has MAE $2.25 and MAPE 27%; both metrics favor Model B.)
- Actual daily volumes are 0, 10, and 30 units; predictions are 2, 8, and 36 units. Calculate WAPE and MAE. Which is more directly suited to a decision that gives each day equal importance and wants typical error in units? (Answer: WAPE is 25%; MAE is \(10/3=3.33\) units to two decimal places; MAE directly summarizes equal-weight typical error in units.)