Okay, let's break down how to measure the accuracy of a sales time series prediction model and what constitutes "good" accuracy.
How to Measure Accuracy
Measuring the accuracy of a time series forecast involves comparing the predicted values (y^t) with the actual observed values (yt) over a specific period (the test set or validation set). Several metrics are commonly used, each with its pros and cons:
1. Metrics Based on Absolute Errors:
- MAE (Mean Absolute Error):
- Formula: MAE=n1∑
2. Metrics Based on Percentage Errors:
- MAPE (Mean Absolute Percentage Error):
- Formula: MAPE=n1∑
3. Scaled Error Metrics:
- MASE (Mean Absolute Scaled Error):
- Formula: MASE= (using naive seasonal differencing) or
4. Other Metrics:
- WAPE (Weighted Absolute Percentage Error) / RB MAE (Retail Benchmark MAE):
- Formula: WAPE=∑t=1 (Essentially, it's the sum of absolute errors divided by the sum of actuals)
Which Metric to Choose?
- For comparing across different scales: MASE or WAPE are generally preferred over MAPE.
- For interpretability in the original units: MAE or RMSE. RMSE is sensitive to large errors.
- If large errors are particularly undesirable: RMSE.
- If all errors should be weighted equally by magnitude: MAE.
- If the direction of change is important: Directional Accuracy.
Crucial Consideration: Validation Strategy
Always use a temporal split. Train your model on data up to time T, and test it on data from time T+1 onwards. Never shuffle time series data before splitting, as this destroys the temporal dependencies crucial for forecasting. Techniques like rolling forecasts or time series cross-validation (e.g., expanding window) are appropriate.
What is Considered "Good" Accuracy?
This is the hardest question, as there's no universal threshold. "Good" is highly context-dependent. Here's what influences it:
-
Baseline Performance: The most important comparison is against simple baseline models:
- Naive Forecast: Predicts the last observed value (y^t=yt−1).
General Guidelines (Use with Caution):
- MAPE: Values below 10-15% are often considered good for stable, aggregated data (like monthly sales). Values above 30-50% might be acceptable for very granular or volatile data (like daily sales of specific SKUs). Remember its limitations.
- MASE: Values below 1 indicate the model is better than naive. <0.5 is often considered very good, and <0.3 excellent.
- MAE/RMSE: Compare the value relative to the average sales volume. A CV(RMSE) (Coefficient of Variation of RMSE) below 0.15-0.20 might be considered good, but this varies wildly by industry and data granularity.
In summary:
- Use appropriate metrics like MAE, RMSE, MASE, or WAPE, chosen based on your data and business needs.
- Always validate on a hold-out set using a temporal split.
- Compare your model's performance against simple baselines (Naive, Seasonal Naive).
- Consider data characteristics (volatility, granularity, horizon).
- Understand the business cost of forecast errors.
"Good" accuracy is relative – it means your model provides valuable, actionable insights better than simpler methods, given the inherent predictability (or lack thereof) of your specific sales data and business context.