1. Definition
WMAPE is a weighted version of MAPE that gives more importance to data points with larger actual values.
$WMAPE = \frac{\sum_{i=1}^N |y_i – \hat{y}_i|}{\sum_{i=1}^N |y_i|}$
where:
- $N$ = number of forecasts
- $y_i$ = actual value
- $\hat{y}_i$ = predicted value
2. Intuition
- Standard MAPE = average of percentage errors for each observation → all points weighted equally.
- WMAPE = total absolute error divided by total actual demand → higher actual values contribute more weight.
- This makes WMAPE less distorted by small actual values (a major weakness of MAPE).
3. Example
Suppose actual vs predicted demand:
| Observation | Actual ($y$) | Predicted ($\hat{y}$) | Error $|y – ŷ|$ |
|---|---|---|---|
| 1 | 100 | 90 | 10 |
| 2 | 200 | 220 | 20 |
| 3 | 400 | 360 | 40 |
- Numerator = $10 + 20 + 40 = 70$
- Denominator = $100 + 200 + 400 = 700$
$WMAPE = \frac{70}{700} = 0.10 = 10\%$
4. Properties
- Range: 0 → ∞ (usually expressed as a percentage).
- Lower is better.
- Easy to interpret: “on average, the forecast was off by X% of actual demand.”
- More robust than MAPE when actuals can be close to zero.
5. Comparison with Other Metrics
- MAPE: Simple, but unstable if actuals are small.
- WMAPE: Weighted by actual demand → better for business forecasting (e.g., sales, inventory).
- sMAPE: Symmetric error measure → avoids asymmetry in over/under forecasting.
- RMSE/MAE: Absolute error measures (not percentages).
Use WMAPE when business cares about aggregate accuracy across all demand, not per-item fairness.
6. Python Example
import numpy as np
def wmape(y_true, y_pred):
return np.sum(np.abs(y_true - y_pred)) / np.sum(np.abs(y_true))
y_true = np.array([100, 200, 400])
y_pred = np.array([90, 220, 360])
print("WMAPE:", wmape(y_true, y_pred))
Output:
WMAPE: 0.1 (10%)
Summary
- WMAPE = total absolute error ÷ total actual demand.
- More business-friendly than MAPE, avoids instability at low actuals.
- Range: 0 → ∞, lower = better.
- Common in forecasting accuracy for sales, demand, inventory, supply chain.
