The HPF Procedure

PROC HPF Statement

  • PROC HPF options;

You can specify the following options:

BACK=n

specifies the number of observations before the end of the data where the multistep forecasts are to begin, where n is an integer. By default, BACK=0.

DATA=SAS-data-set

names the SAS-data-set that contains the input data for the procedure to forecast. If this option is not specified, the most recently created SAS data set is used.

LEAD=n

specifies the number of periods ahead to forecast (forecast lead or horizon), where n is relative to the last observation in the input data set and not to the last nonmissing observation of a particular series. Thus, if a series has missing values at the end, the actual number of forecasts computed for that series will be greater than n. By default, LEAD=12

MAXERROR=number

limits the number of warning and error messages produced during the execution of the procedure to number. This option is particularly useful in BY-group processing where it can be used to suppress recurring messages. By default, MAXERROR=50.

NOOUTALL

requests that only forecasts be written to the OUT= and OUTFOR= data sets. This option includes only the final forecast observations in the output data sets, not the one-step forecasts for the data before the forecast period.

The OUT= and OUTFOR= data sets will contain only the forecast results that start at the next period that follows the last observation and go to the forecast horizon that is specified in the LEAD= option.

OUT=SAS-data-set

names the output data set to contain the forecasts of the variables that are specified in the subsequent FORECAST statements. If an ID statement is included, the variable specified in it will also be included in the OUT= data set. The values are accumulated based on the ACCUMULATE= option, and forecasts are appended to these values based on the USE= option in the FORECAST statement. The OUT= data set is particularly useful in extending the independent variables when forecasting dependent series associated with regression and autoregression models. If the OUT= option is not specified, a default output data set named DATAn is created, where n is the next integer greater than the suffix of any other DATAn data sets. If you do not want the OUT= data set created, then use OUT=_NULL_.

OUTEST=SAS-data-set

names the output data set to contain the model parameter estimates and the associated test statistics and probability values. The OUTEST= data set is particularly useful for evaluating the significance of the model parameters and understanding the model dynamics.

OUTFOR=SAS-data-set

names the output data set to contain the forecast time series components (actual, predicted, lower confidence limit, upper confidence limit, prediction error, and prediction standard error). The OUTFOR= data set is particularly useful for displaying the forecasts in tabular or graphical form.

OUTPROCINFO=SAS-data-set

names the output data set to contain information in the SAS log, specifically the number of notes, errors, and warnings and the number of series processed, forecasts requested, and forecasts failed.

OUTSEASON=SAS-data-set

names the output data set to contain the seasonal statistics. The statistics are computed for each season as specified by the INTERVAL= option or the SEASONALITY= option in the ID statement. The OUTSEASON= data set is particularly useful when analyzing transactional data for seasonal variations.

OUTSTAT=SAS-data-set

names the output data set to contain the statistics of fit (or goodness-of-fit statistics). The OUTSTAT= data set is particularly useful for evaluating how well the model fits the series. The statistics of fit are based on the entire range of the time series regardless of whether the HOLDOUT= option is specified.

OUTSUM=SAS-data-set

names the output data set to contain the summary statistics and the forecast summation. The summary statistics are based on the accumulated time series when the ACCUMULATE= or SETMISSING= options are specified. The forecast summations are based on the LEAD=, STARTSUM=, and USE= options. The OUTSUM= data set is particularly useful when forecasting large numbers of series and a summary of the results is needed.

OUTTREND=SAS-data-set

names the output data set to contain the trend statistics. The statistics are computed for each time period as specified by the ID statement INTERVAL= option. The OUTTREND= data set is particularly useful when analyzing transactional data for trends.

PLOT=option | (options)

specifies the graphical output desired. By default, the HPF procedure produces no graphical output. You can specify the following printing options:

ACF

plots prediction error autocorrelation function graphics.

ALL

is the same as specifying all of the PLOT= options.

BASIC

equivalent to specifying PLOT=(CORR ERRORS MODELFORECASTS). In the context of IDM models, the StockingLevelPlot is generated in place of the prediction error correlation panel plot.

CORR

plots the prediction error series graphics panel containing the ACF, IACF, PACF, and white noise probability plots. Note in the context of IDM models PLOT=CORR produces no additional output.

ERRORS

plots prediction error time series graphics.

FORECASTS

plots forecast graphics.

FORECASTSONLY

plots the forecast in the forecast horizon only.

IACF

plots prediction error inverse autocorrelation function graphics.

LEVELS

plots smoothed level component graphics.

MODELFORECASTS

plots the one-step ahead model forecast and its confidence bands in the historical period; the forecast and its confidence bands over the forecast horizon.

MODELS

plots model graphics.

PACF

plots prediction error partial autocorrelation function graphics.

PERIODOGRAM

plots prediction error periodogram.

SEASONS

plots smoothed seasonal component graphics.

SPECTRUM

plots periodogram and smoothed periodogram of the prediction error series in a single graph. The SPECTRUM plot admits the specification of options to control some aspects of the generation of the smoothed periodogram. No options are required to use PLOT=SPECTRUM. To specify options use the following syntax:

  • SPECTRUM=(options)

Valid options for the SPECTUM plot include:

ALPHA=value

specifies the significance level for upper and lower confidence limits about the smoothed periodogram estimates of spectral density. The default is ALPHA=0.4.

CENTER=YES|NO

specifies whether mean adjustment is desired for the error series before computation of the smoothed periodogram estimates of spectral density. The default is NO.

TRENDS

plots smoothed trend (slope) component graphics.

WN

plots white noise graphics.

For example, PLOT=FORECASTS plots the forecasts for each series.

PRINT=option | (options)

specifies the printed output desired. By default, the HPF procedure produces no printed output. The following printing options are available:

ESTIMATES

prints the results of parameter estimation (OUTEST= data set).

FORECASTS

prints the forecasts (OUTFOR= data set).

PERFORMANCE

prints the performance statistics for each forecast.

PERFORMANCESUMMARY

prints the performance summary for each BY group.

PERFORMANCEOVERALL

prints the performance summary for all of the BY groups.

SEASONS

prints the seasonal statistics (OUTSEASON= data set).

STATISTICS

prints the statistics of fit (OUTSTAT= data set).

STATES

prints the backcast, initial, and final states.

SUMMARY

prints the summary statistics for the accumulated time series (OUTSUM= data set).

TRENDS

prints the trend statistics (OUTTREND= data set).

ALL

is the same as PRINT=(ESTIMATES FORECASTS STATISTICS SUMMARY). PRINT=(ALL TRENDS SEASONS) prints all of the options in the preceding list.

For example, PRINT=FORECASTS prints the forecasts, PRINT=(ESTIMATES FORECASTS) prints the parameter estimates and the forecasts, and PRINT=ALL prints all of the preceding output.

The PRINT= option produces printed output for these results with the Output Delivery System (ODS). The PRINT= option produces results similar to the data sets listed in parenthesis for some of the options in the preceding list.

PRINTDETAILS

specifies that output requested with the PRINT= option be printed in greater detail.

SEASONALITY=number

specifies the length of the seasonal cycle. For example, SEASONALITY=3 means that every group of three observations forms a seasonal cycle. The SEASONALITY= option is applicable only for seasonal forecasting models. By default, the length of the seasonal cycle is one (no seasonality) or the length implied by the INTERVAL= option specified in the ID statement. For example, INTERVAL=MONTH implies that the length of the seasonal cycle is 12.

SORTNAMES

specifies that the variables specified in the FORECAST statements be processed in sorted order.

STARTSUM=n

specifies the starting forecast lead (or horizon) for which to begin summation of the forecasts specified by the LEAD= option. The STARTSUM= value must be less than the LEAD= value. The default is STARTSUM=1—that is, the sum from the one-step-ahead forecast to the multistep forecast specified by the LEAD= option.

The prediction standard errors of the summation of forecasts take into account the correlation between the multistep forecasts. The section Details: HPF Procedure describes the STARTSUM= option in more detail.

Last updated: July 31, 2025