SAS Visual Forecasting lets you automate most models and focus the time of your expert forecasters on those models that need extra attention. The Interactive Modeling Node in SAS Visual Forecasting lets you easily drill down into a specific time series that needs some TLC from an expert. Although the Interactive Modeling Node in SAS Visual Forecasting has been around since Stable release 2020.1.3 (February 2021), it has undergone a number of enhancements over the last 16 months.
At its essence, the Interactive Modeling tab lets you lets you zoom in on a single time series to improve its forecast by:
This blog will demonstrate using the Interactive Modeling node in the latest LTS version (2022.1 – May 2022). I’ll also give you a sneak peek at the model download capabilities, just recently made available in stable release 2022.1.1 (May 2022). I catalog enhancements by stable release since the inception of the Interactive Modeling node in February 2021.
Using the Interactive Modeling Node
Once you run the automatic forecasting, you can add an Interactive Modeling node between a modeling node (or nodes) and the Model Comparison node.
Let’s say you are interested in electricity generation by source and state. Our example will use the ELECGENSUBSET data set, which includes a number of variables as shown below:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
If you are unfamiliar with setting up a SAS Visual Forecasting project in SAS Model Studio, please see my course Using SAS Visual Forecasting on SAS Viya 4 https://eduvle.sas.com/course/view.php?id=1976, Chapter 3, Visual Interface for Visual Forecasting, which includes step-by-step instructions for building a pipeline with the ELECGENSUBSET data in exercise 03_021_Build_Pipeline. Recall that if you build a pipeline using the auto-forecasting template, the Auto-forecasting node will generate exponential smoothing (ESM), autoregressive integrated moving average with any significant inputs (ARIMAX) and intermittent demand (IDM) models. The Auto-forecasting node will then select the best model for each series using the mean absolute percent error (MAPE).
Three ways to add in interactive modeling node:
2. Select connector (in our example, the connector between the Auto-forecasting node and the Model Comparison node), right click, Insert, Postprocessing, Interactive Modeling.
3. Select Model Comparison node, right click, Add parent Node, Postprocessing, Interactive Modeling.
Once you have run the Interactive Modeling Node, right click and open it. There are three panes:
Forecast Pane
In the Forecast pane you can select individual time series (or multiple time series by holding down the Control key) in the right pane where all of the series are listed. Below I’ve selected Natural Gas for Pennsylvania (PA), Illinois (IL), and Maryland (MD).
Envelope plots including predicted and actual range, predicted and actual one and two standard deviations can be toggled off or on. As you see below, when they are toggled on a check mark appears next to “Actual values” and “Predicted values” under the envelope plot icon. Actual values (shown as dots), predicted values (shown as lines), and confidence limits for the forecasts (shaded areas) can also be turned on or off.
If you try to select more than 16 series, only 16 will be selected. A message will appear that “One or more of the selected series cannot be displayed on the graph. The maximum number of series that can be displayed is 16,” as illustrated below.
Modeling Pane
By default when you open the Interactive modeling node you will see the Modeling pane for all of the series, as shown below (269 of 269 series).
You can hone in on a specific series, such as Wind: CA, as shown below.
Or natural gas: PA, as shown below. Expand the graph using the outfacing arrows.
By default you will arrive in Graph view. Select table view.
This lets you see the full table including the selected _MODEL_, the Time ID values, Actual Values, Predicted Values, Prediction Standard Errors, Lower Confidence Limits, and Upper Confidence Limits.
|
Close the window. Now you can select the down arrow to the right of View diagnostic plot/table for a number of choices.
Explore these. Below see the White noise probability test (log scale).
Model fit includes parameter estimates and statistics of fit.
Below see parameter estimates.
Forecasts include:
For example, see Seasonal cycles below.
Basic error analysis includes Prediction errors and a Prediction error histogram. See the histogram below.
To download plots and tables select the down arrow.
Compare Models
Select the models you want to compare and then click the icon
to compare selected models.
As shown below, the best model is based on the selection criterion.
Select the icon
at the top right to customize which criteria are shown.
I’ve selected the Akaike Information Criterion (AIC), Amemiya’s prediction criterion (APC), mean absolute percent error (MAPE), and root mean square error (RMSE). The selection criterion that you use depends heavily on the domain in which you are working. For example, many economists use MAPE and many biologists commonly use RMSE. For a full description of the model selection criteria available see the SAS Model Studio: SAS Visual Forecasting User’s Guide .
Notice that the MAPE (the default selection criterion) selects a different model from the AIC, APC, or RMSE.
If you right click a model, you can set it as champion or created a copy of the selected model.
You will have the opportunity to confirm you want to commit to these changes.
Once you have set a champion, the champion icon
will appear next to the model that you set as champion.
To deselect the champion setting you can select the champion icon at the top right of your model table or right click the champion model and select Unselect champion model. You will need to commit again.
To see full model details roll over the model details or select the details icon.
To create your own model select the icon and choose exponential smoothing, ARIMA or subset (factored) ARIMA.
Errors or warnings are indicated in the Details column for the model:
— Error
— Warning
Right-click the model and select View status details. The Status Details window shows the error or warning messages generated by the model.
Series Analysis Pane
A number of series analysis graphs are available to you, such as seasonal cycles, percent change, histogram illustrating the distribution, etc.
To view details, select the vertical ellipsis (snowman) at the bottom right of the graph of interest.
You can turn on Graph view, Table view, or both.
Below see an example of a seasonal cycle graph.
Below is a close up view of a percent change graph.
The distribution of the data by the dependent variable electricity generation in megawatt-hours is illustrated below.
Advanced diagnostic graphs such as IACF and PACF are available by right clicking and selecting autocorrelation analysis.
For information on how to interpret these diagnostic graphs, see my previous post on interpreting results and diagnostic plots
Downloading data
Notice the download arrow in top right of your Graph view. You can download the data for this series.
It will download to your downloads folder as a comma separated (.csv) file.
This functionality is available in LTS 2022.1.
Downloading Models: Sneak Peek (first available in stable 2022.1.1)
A new functionality available in stable 2022.1.1. is the ability to easily download your models from SAS Model Studio. From the Modeling tab in the Interactive Modeling node simply right click on the model that you want to download. You can download the system-generated models or your own custom-build models.
It will download locally as a CASL file.
You can access the file in your Downloads folder.
For more details see the Model Studio: SAS Visual Forecasting User’s Guide
You can also download the log for the Interactive node which provides a bit of information.
Summary
Many time series will get good forecasts simply through automated forecasting with SAS Model Studio. But for those that don’t, now you see how easy it is to diagnose, tweak and compare models using the Interactive Modeling Node to achieve high performance for even difficult to model time series.
Since its appearance in stable release 2020.1.3 (February 2021), the Interactive Modeling node has been continuously enhanced and improved. I’ve detailed these improvements by version/date below.
Series Analysis tab
Modeling tab
For More Information
Find more articles from SAS Global Enablement and Learning here.
Great article Beth! Thanks for sharing
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.