The HPFENGINE Procedure
Getting Started: HPFENGINE Procedure
(View the complete code for this example.)
In its simplest usage, the HPFENGINE procedure produces results similar to those of the HPF procedure:
proc hpfengine data=sashelp.air
print=(select summary);
id date interval=month;
forecast air;
run;
The GLOBALSELECTION= and REPOSITORY= options assume their respective default values. Therefore automatic selection is performed for the AIR series in SASHELP.AIR by using the models specified in the BEST selection list. The selection list BEST is found, together with the smoothing models it references, in SASHELP.HPFDFLT.
The results of the automatic model selection are displayed in Figure 1. A summary of the forecast is shown in Figure 2.
Figure 1: Selection Results
| Model Selection Criterion = RMSE | |||
|---|---|---|---|
| Model | Statistic | Selected | Label |
| SMSIMP | . | Removed | Simple Exponential Smoothing |
| SMDAMP | . | Removed | Damped-Trend Exponential Smoothing |
| SMLIN | . | Removed | Linear Exponential Smoothing |
| SMADWN | 12.245596 | No | Winters Method (Additive) |
| SMWINT | 10.579085 | Yes | Winters Method (Multiplicative) |
| SMSEAS | 14.169905 | No | Seasonal Exponential Smoothing |
Figure 2: Forecast Summary
| Forecast Summary | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Variable | Value | JAN1961 | FEB1961 | MAR1961 | APR1961 | MAY1961 | JUN1961 | JUL1961 | AUG1961 | SEP1961 | OCT1961 | NOV1961 | DEC1961 |
| AIR | Predicted | 445.2972 | 418.1426 | 464.0889 | 494.0261 | 504.9584 | 572.5947 | 662.7040 | 653.7742 | 545.8935 | 487.7147 | 415.2594 | 459.6067 |
The first four models in the selection list are nonseasonal smoothing models. The HPFENGINE procedure determined that the series AIR in SASHELP.AIR was seasonal and attempted to fit only seasonal models.
The multiplicative Winters method produced a fit with the smallest root mean squared error (RMSE).
As another example, consider the problem of comparing the performance of multiple ARIMA models for a particular series. This is done by using the HPFARIMASPEC procedure as follows to specify the models.
proc hpfarimaspec repository=sasuser.repository
name=arima1;
dependent symbol=air q=1
diflist=(1 12) noint transform=log;
run;
proc hpfarimaspec repository=sasuser.repository
name=arima2;
dependent symbol=air q=(1,12)
diflist=(1 12) noint transform=log;
run;
The model specifications are grouped together in a selection list. Selection lists are built with the HPFSELECT procedure.
proc hpfselect repository=sasuser.repository
name=myselect;
spec arima1 arima2;
run;
The HPFENGINE procedure uses the GLOBALSELECTION= option to reference the selection list that contains the two ARIMA models. Selection /results are shown in Figure 3, and the forecast plot is shown in Figure 4.
proc hpfengine data=sashelp.air
repository=sasuser.repository
globalselection=myselect
print=(select forecasts)
plot=forecasts;
id date interval=month;
forecast air;
run;
Figure 3: Selection and Forecast Results
| Model Selection Criterion = MAPE | |||
|---|---|---|---|
| Model | Statistic | Selected | Label |
| ARIMA1 | 3.2553815 | No | ARIMA: Log( AIR ) ~ D = (1,12) Q = 1 NOINT |
| ARIMA2 | 2.9672282 | Yes | ARIMA: Log( AIR ) ~ D = (1,12) Q = (1,12) NOINT |
Figure 4: Forecasts
