Using SAS to Automatically Forecast
In honor of Easter, here’s a rare egg for the BI Notes blog – information about SAS statistical products! Today guest blogger Phil Low offers some insight about some of the other SAS procedures, particularly those used for the forecasting.
Would You Manually Forecast 60,000 Data Items?
Ever wake up to find you have to produce forecasts for 60,000 different items? As a data analyst for a medical supply distributor, I have. Manual forecasting under these conditions is neither feasible nor profitable. Enter the FORECAST and ESM procedures. These two procedures combined can produce more than 10 different forecast models to choose from, and can easily be compared against each other with goodness of fit stats.
The FORECAST procedure was written in the 1980s and is a simple auto regression with or without trend. Stepwise selection is used to determine which autoregressive lags make it into the final model. Because it is so old, some the more advanced features are better represented by ESM or AUTOREG. The ESM procedure is a moving average model. What’s great about ESM is its ability to throw deterministic trend and seasonality into the mix. You can customize just about every aspect of the model and every possible statistic is printed out.
If you really want to get fancy, you can throw in some lower order ARMA models. Be careful about the goodness of fit statistics though, some are calculated differently in the ARIMA procedure than in FORECAST or ESM. To get the correct goodness of fit statistics, you will have to calculate the formulas manually. SAS tech support has pre-written code available.
Once you have run the models, simply choose a goodness of fit statistic to rely on, be it RMSE, MAPE, AIC, SBC, etc…, and run with the champion. This methodology is not perfect of course, but I’ve found it to be incredibly useful at producing decent forecasts for an infinite number of items in mere minutes. For high value items with a long history, I will often go ahead and build a model using the AUTOREG or ARIMA procedures, which as a manual model can often be a much tighter fit. This combination of manually forecasting for important items and automatically forecasting the remaining items yields quite satisfactory results.
More about Phil Low
Phil Low is a data analyst at MDR specialty distribution corporation. As the only member of the data analytics department, Phil works very hard at writing code so that he won’t have to work so hard. You can connect with Phil through LinkedIn.
Image courtesy of Microsoft image library.
Never miss a BI Notes post!
Click here for free subscription. Once you subscribe you'll be asked to confirm your subscription through your email account. You email address is kept private and you can unsubscribe anytime.
Latest posts by Tricia Aanderud (see all)
- Use these 7 Data Storytelling Examples to Make Your Insights more Meaningful Today - 2018-06-09
- Use Network Analysis to Understand Your Customers with SAS Visual Analytics 8.2 - 2018-01-21
- My 7 Favorite Features in SAS Visual Analytics 8.2 on Viya - 2018-01-14
- Designing Dashboards: Finding the Fantastic Five Colors - 2017-06-19
- Creating a Web Analytics Report in SAS Visual Analytics 8.1 - 2017-06-19
Tags: Coding Tips