The HPFENGINE Procedure
Example 5.5 HPFENGINE and HPFDIAGNOSE Procedures
(View the complete code for this example.)
The HPFDIAGNOSE procedure is often used in conjunction with the HPFENGINE procedure. This example demonstrates the most basic interaction between the two. In the following statements, model specifications are created by the HPFDIAGNOSE procedure and are those specifications are then fit to the data by using the HPFENGINE procedure.
proc hpfdiagnose data=sashelp.air
repository=work.repository
outest=est;
id date interval=month;
forecast air;
run;
proc hpfengine data=sashelp.air
inest=est outest=outest
repository=work.repository
print=(select estimates summary)
plot=forecasts;
id date interval=month;
forecast air;
run;
The HPFENGINE procedure output is shown in Output 5.5.1. Forecasts are shown in Output 5.5.2.
Output 5.5.1: Selection and Forecast Results
| Model Selection Criterion = RMSE | |||
|---|---|---|---|
| Model | Statistic | Selected | Label |
| diag0 | 10.695241 | No | ARIMA: AIR ~ P = 1 D = (1,12) NOINT |
| diag1 | 10.579085 | Yes | Winters Method (Multiplicative) |
Output 5.5.2: Forecasts

It is also possible to compare the performance of model specifications that you create with those automatically generated by the HPFDIAGNOSE procedure.
In the following statements, two model specifications are created, together with a selection list to reference those specifications.
proc hpfarimaspec repository=work.repository name=myarima;
forecast symbol=sale transform=log q=(1 12) diflist=(1 12) noint;
run;
proc hpfucmspec repository=work.repository name=myucm;
forecast symbol=sale transform=log;
irregular;
level;
season length=12;
run;
proc hpfselect repository=work.repository name=select;
spec myarima myucm;
run;
The model selection list is passed to the HPFDIAGNOSE procedure by using the INSELECTNAME= option as follows. The new selection list ultimately created by the HPFDIAGNOSE procedure includes all model specifications in the INSELECTNAME= selection list together with automatically generated model specifications.
proc hpfdiagnose data=sashelp.air
inselectname=select
repository=work.repository
outest=est
criterion=mape;
id date interval=month;
forecast air;
run;
The HPFENGINE procedure selects the best-fitting model as follows. Selection results are shown in Output 5.5.3, parameter estimates of the selected model are shown in Output 5.5.4, and the forecast summary is shown in Output 5.5.5.
proc hpfengine data=sashelp.air
inest=est
repository=work.repository
print=(select estimates summary)
plot=forecasts;
id date interval=month;
forecast air;
run;
Output 5.5.3: Model Selection Results
| Model Selection Criterion = MAPE | |||
|---|---|---|---|
| Model | Statistic | Selected | Label |
| diag3 | 3.1212192 | No | ARIMA: AIR ~ P = 1 D = (1,12) NOINT |
| diag4 | 3.0845016 | No | Winters Method (Multiplicative) |
| MYARIMA | 2.9672282 | Yes | ARIMA: Log( SALE ) ~ D = (1,12) Q = (1,12) NOINT |
| MYUCM | 3.1842031 | No | UCM: Log( SALE ) = LEVEL + SEASON + ERROR |
Output 5.5.4: Parameter Estimates of Selected Model
| Parameter Estimates for MYARIMA Model | |||||
|---|---|---|---|---|---|
| Component | Parameter | Estimate | Standard Error | t Value | Approx Pr > |t| |
| AIR | MA1_1 | 0.24576 | 0.07364 | 3.34 | 0.0011 |
| AIR | MA1_12 | 0.50641 | 0.07676 | 6.60 | <.0001 |
Output 5.5.5: Forecast Summary
| Forecast Summary | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Variable | Value | JAN1961 | FEB1961 | MAR1961 | APR1961 | MAY1961 | JUN1961 | JUL1961 | AUG1961 | SEP1961 | OCT1961 | NOV1961 | DEC1961 |
| AIR | Predicted | 450.3513 | 425.6158 | 478.6340 | 501.0466 | 512.5109 | 584.8311 | 674.9025 | 667.8935 | 558.3906 | 499.4696 | 430.1668 | 479.4592 |