MAPE, or Mean Absolute Percentage Error, is a common metric used to measure the accuracy of forecasted values in comparison to actual values. It calculates the error as a percentage of the actual values, but it is important to understand how it behaves with respect to positive and negative errors, which can lead to skewed results and put more emphasis (penalty) on overestimations than underestimations.
Mathematical Explanation
The formula for MAPE is:
[
\text{MAPE} = \frac{1}{n} \sum_{t=1}^{n} \left| \frac{A_t - F_t}{A_t} \right| \times 100
]
Where:
- (A_t) = actual value
- (F_t) = forecast value
- (n) = number of forecasts.
Asymmetry in MAPE
Because of how the formula is structured, we can see that the penalty for underestimations (when the forecast is lower than the actual) results in a limit since the error percentage can be as low as zero and cannot exceed 100%. However, there is no upper limit for overestimations because the actual number can approach zero.
Example
To illustrate the asymmetry of MAPE, let’s consider a simple example with three forecasts:
| Actual Value (A) | Forecast Value (F) | Error (A - F) | Absolute Percentage Error ( |(A - F)/A| \times 100 ) |
|-------------------|---------------------|----------------|--------------------------------------------------|
| 100 | 90 | +10 | ( |(100 - 90)/100| \times 100 = 10 % ) |
| 100 | 110 | -10 | ( |(100 - 110)/100| \times 100 = 10 % ) |
| 100 | 200 | -100 | ( |(100 - 200)/100| \times 100 = 100 % ) |
- First Forecast (90): The prediction is lower than the actual value, yielding a 10% error.
- Second Forecast (110): The prediction is higher, yielding a 10% error again.
- Third Forecast (200): The prediction is significantly higher, yielding a 100% error.
Calculating MAPE
Now, let’s calculate MAPE:
- For the first two forecasts (90 and 110), each contributes 10% to MAPE.
- The third forecast (200) contributes a maximum percentage error of 100%.
Total MAPE contribution:
- ( (10 + 10 + 100) / 3 = \frac{120}{3} = 40% )
Notice that while the forecasts of 90 and 110 were both off by the same amount (10% each), the 200 prediction inflated the average error significantly due to how MAPE treats those errors.
Conclusion
In this example, the MAPE penalizes the model heavily for overforecasting (200), whereas underforecasting (90, 110) does not carry the same weight. Therefore, if a model's forecasts tend to be high (overforecasting), optimizing for MAPE might lead to a preference for models that underforecast since the associated penalties for underestimations are much lower. This illustrates the inherent asymmetry in MAPE, which is essential for data scientists and forecasters to understand when selecting error metrics for their work.