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

The HPFENGINE Procedure

Model Selection Criterion = RMSE
ModelStatisticSelectedLabel
diag010.695241NoARIMA: AIR ~ P = 1 D = (1,12) NOINT
diag110.579085YesWinters Method (Multiplicative)


Output 5.5.2: Forecasts

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

The HPFENGINE Procedure

Model Selection Criterion = MAPE
ModelStatisticSelectedLabel
diag33.1212192NoARIMA: AIR ~ P = 1 D = (1,12) NOINT
diag43.0845016NoWinters Method (Multiplicative)
MYARIMA2.9672282YesARIMA: Log( SALE ) ~ D = (1,12) Q = (1,12) NOINT
MYUCM3.1842031NoUCM: Log( SALE ) = LEVEL + SEASON + ERROR


Output 5.5.4: Parameter Estimates of Selected Model

Parameter Estimates for MYARIMA Model
ComponentParameterEstimateStandard
Error
t ValueApprox
Pr > |t|
AIRMA1_10.245760.073643.340.0011
AIRMA1_120.506410.076766.60<.0001


Output 5.5.5: Forecast Summary

Forecast Summary
VariableValueJAN1961FEB1961MAR1961APR1961MAY1961JUN1961JUL1961AUG1961SEP1961OCT1961NOV1961DEC1961
AIRPredicted450.3513425.6158478.6340501.0466512.5109584.8311674.9025667.8935558.3906499.4696430.1668479.4592


Last updated: March 05, 2026