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.
Service: forecasting and statistical studies Research note: intermittent demand forecasting, measured
References
- 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
- 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.
- Hyndman, R. J., Athanasopoulos, G. (2021). Forecasting: principles and practice, 3rd edition. OTexts, Melbourne. otexts.com/fpp3