Library · Metric

MAPE: mean absolute percentage error

MAPE is easy to explain and is the measure most planning teams already report. It is undefined when the actual value is zero, it explodes on low volumes, and the forecast that minimises it sits below the mean.

By , published

Definition

The mean absolute percentage error expresses each error as a share of the actual value, then averages.

MAPE = mean( |yt − ft| ÷ |yt| ) × 100

A MAPE of 12 reads as an average miss of 12 %. The division by the actual value is what makes the measure readable, and it is also the source of each of its problems.

Worked example

A product sells around 100 units a month with a multiplicative noise. We search for the constant forecast with the lowest MAPE and compare it with the mean of the demand.

import numpy as np

rng = np.random.default_rng(7)
demand = rng.lognormal(mean=np.log(100), sigma=0.6, size=20_000)

grid = np.arange(40, 161)
mape = [100 * np.mean(np.abs(demand - f) / demand) for f in grid]
best = grid[int(np.argmin(mape))]
print(f"mean demand:                  {demand.mean():.1f}")
print(f"median demand:                {np.median(demand):.1f}")
print(f"forecast with the lowest MAPE: {best}")
print(f"MAPE of that forecast:        {min(mape):.1f}")
print(f"MAPE of the mean forecast:    {100 * np.mean(np.abs(demand - demand.mean()) / demand):.1f}")

Output, produced by running the code above when this page was built:

mean demand:                  118.9
median demand:                99.3
forecast with the lowest MAPE: 70
MAPE of that forecast:        44.8
MAPE of the mean forecast:    66.2

The forecast that wins on MAPE is well below the mean and even below the median. A planner who orders that quantity every month runs short on average.

Where it misleads

  • An actual value of zero makes the term infinite. Periods with zero demand are then dropped, which removes exactly the periods that define an intermittent item.
  • A miss of 2 units on an actual of 1 counts 200 %, a miss of 2 on 1,000 counts 0.2 %. Averaged over a catalogue, MAPE is governed by the slowest items.
  • An under-forecast can cost at most 100 %, an over-forecast has no ceiling. Minimising MAPE therefore biases the forecast downward, as the example shows.

If the business needs a percentage, WAPE divides the total error by the total demand and stays defined with zeros. For comparison across series, a scaled error such as MASE or RMSSE is the standard answer.

In our work

When a client's target is written in MAPE, we keep the figure for continuity and show what it hides: the bias of the forecast and the share of periods the calculation had to drop because the actual value was zero.

References

  1. Hyndman, R. J., Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679-688. doi:10.1016/j.ijforecast.2006.03.001
  2. Kolassa, S., Schütz, W. (2007). Advantages of the MAD/Mean ratio over the MAPE. Foresight: The International Journal of Applied Forecasting, 6, 40-43.
  3. Hyndman, R. J., Athanasopoulos, G. (2021). Forecasting: principles and practice, 3rd edition. OTexts, Melbourne. otexts.com/fpp3

Have a question like this one on your own data? Tell us what you need in a few lines.

Send us the brief

Related pages

  • sMAPE: symmetric mean absolute percentage errorsMAPE was designed to fix the unbounded errors of MAPE. It is bounded, but it penalises a forecast that is too low more than one that is too high by the same amount, and every period with zero demand gets the maximum error.
  • WAPE: weighted absolute percentage errorWAPE, also called the MAD/mean ratio, is the total absolute error divided by the total demand. It stays defined when some periods are zero and is the percentage measure that survives a catalogue of slow items.
  • Forecast bias: mean errorBias is the average of forecast minus actual. It says whether a method orders too much or too little over time, which no accuracy measure reports. A biased forecast can have the best accuracy score.
All library pages