WMAPE (Weighted Mean Absolute Percentage Error)
WMAPE refers to a weighted absolute percentage error, but the weighting convention must be stated. A common formula divides total absolute forecast error by total absolute actuals:
\[ \text{WMAPE} = \frac{\sum_i |y_i - \hat{y}_i|}{\sum_i |y_i|} \]
which is the same expression that appears under the name WAPE, and is described by Hyndman as the MAD/Mean ratio introduced by Kolassa and Schütz. Here y is the actual and ŷ the forecast for the same item and period. The displayed ratio is a fraction; multiply by 100 to report a percentage. A weighted average of per-item percentage errors is another possible convention and generally gives a different result.
When weighted MAPE equals WAPE
A weighted average of per-item percentage errors and a ratio of totals are generally different formulas. For nonzero actuals, weights proportional to absolute actuals make them algebraically identical. This identity explains the relationship, not the historical origin of the name.
For actuals (100, 200, 400) and forecasts (80, 220, 380), every absolute error is 20. The ratio of totals is 60/700 ≈ 8.57%. Per-item percentage errors are 20%, 10%, and 5%. Their ordinary mean is 11.67%, while weighting by actual shares gives (100/700) × 20% + (200/700) × 10% + (400/700) × 5% = 8.57%.
For nonzero actuals, let APEᵢ = |yᵢ − ŷᵢ|/|yᵢ| and wᵢ = |yᵢ|/Σ|y|. Multiplying APEᵢ by wᵢ cancels |yᵢ|, leaving |yᵢ − ŷᵢ|/Σ|y|; summing gives WAPE. Hyndman’s WAPE explanation gives this reformulation. The cancellation is an algebraic relationship, not permission to evaluate 0 × undefined for an individual zero actual.
Weights proportional to absolute actuals establish the identity across all datasets with nonzero actuals. Other weight choices can coincide on particular data, for example when all percentage errors are equal. State the weights rather than treating a matching numerical result as proof of a definition.
Different weights answer different questions
A general weighted MAPE is ΣvᵢAPEᵢ/Σvᵢ, using nonnegative weights vᵢ with a positive sum and defined per-item errors. Revenue or service priorities can motivate weights, but their meaning must match the decision. Negative margin values are not suitable as ordinary averaging weights, and forecast-dependent weights can change when the model changes.
For example, item A sells 100 units at a price of 1 and has 10% error; item B sells 10 units at a price of 100 and has 50% error. Demand-weighted error is (100 × 0.10 + 10 × 0.50)/110 = 13.64%. Revenue weights are 100 and 1,000, giving (100 × 0.10 + 1,000 × 0.50)/1,100 = 46.36%. The higher result emphasizes the expensive item; the forecasts themselves have not changed.
Report whether weights are known before forecasting or derived from the evaluation outcomes. Keep them comparable when comparing models. An unweighted average of store-level WAPE values also differs from pooling their errors and actuals; to recover pooled WAPE, weight each defined store ratio by its absolute-actual denominator. Aggregate absolute errors before division so over- and under-forecasting do not cancel.
The denominator and the zeros
Two more choices sit inside implementations and rarely reach the documentation: what goes in the denominator, and what happens to rows with an actual of zero.
For actuals (0, 10) and forecasts (5, 8), absolute errors are (5, 2). The ratio of totals is 7/10 = 70%. Dropping the zero-actual row reports 2/10 = 20%, hiding five units of error. The weighted per-item expression cannot be evaluated directly at the zero, but the ratio-of-totals convention includes its error whenever the total absolute actual is positive. If all actuals are zero, that ratio is undefined.
Dividing the same error total by total absolute forecasts instead gives 7/13 ≈ 53.85%. Dividing by the mean of the two totals gives 7/11.5 ≈ 60.87%. These are different definitions, not alternative implementations of the stated actual-denominator formula. Their ordering here follows the denominators. sMAPE averages per-item symmetric terms and need not lie between these aggregate ratios; its double-zero case needs a convention.
Report the numerator, denominator, weights and zero handling. MAPE and WAPE have distinct zero cases: WAPE is undefined when all actuals are zero, whereas MAPE has a problem at any zero actual. A falling ratio can also reflect a growing actual-value denominator rather than smaller absolute errors. Report the evaluation population and period alongside the numerator and denominator, especially when demand changes. This comparability issue is separate from selecting a weight convention.
References
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
