The FORECAST statement is an optional statement that is used to specify the overall forecasting environment for the specified model. It can be used to specify the span of observations, the historical period, to be used to compute the forecasts of the future observations. This is done using the SKIPFIRST= and BACK= options. The number of periods to forecast beyond the historical period, and the significance level of the forecast confidence interval, is specified using the LEAD= and ALPHA= options. You can request one-step-ahead series and component forecasts by using the PRINT= option. You can save the series forecasts, and the model-based decomposition of the series, in a SAS table by using the OUTFOR= option. The following example illustrates the use of this statement:
forecast skipfirst=12 back=24 lead=30;
This statement requests that the initial 12 and the last 24 response values be excluded during the forecast computations. The forecast horizon, specified using the LEAD= option, is 30 periods; that is, multistep forecasting begins at the end of the historical period and continues for 30 periods. The actual observation span that is used to compute the multistep forecasting is determined as follows: Suppose that
and
are the observation numbers of the first and the last nonmissing values of the response variable, respectively. As a result of specifying SKIPFIRST=12 and BACK=24, the historical period, or the forecast span, begins at
and ends at
. Multistep forecasts are produced for the next 30 periods—that is, for the observation numbers
to
. Of course, the forecast computations can fail if the model has regressor variables that have missing values in the forecast span. If the regressors contain missing values in the forecast horizon—that is, between the observations
and
—the forecast horizon is reduced accordingly.
You can specify the following options:
-
ALPHA=value
specifies the significance level of the forecast confidence intervals; for example, ALPHA=0.05, which is the default, results in a 95% confidence interval.
-
BACK=integer
SKIPLAST=integer
specifies the holdout sample for the evaluation of the forecasting performance of the model. For example, BACK=10 results in treating the last 10 observed values of the response series as unobserved. A post-sample-prediction-analysis table is produced for comparing the predicted values with the actual values in the holdout period. By default, BACK=0.
enables continuation of the diffuse filtering iterations for k additional iterations beyond the first instance where the initialization of the diffuse state would have otherwise taken place. If the specified k is larger than the sample size, the diffuse iterations continue until the end of the sample. Note that one-step-ahead forecasts are produced only after the diffuse state is initialized. Delaying the initialization leads to reduction in the number of one-step-ahead forecasts. This option is useful when you want to ignore the first few one-step-ahead forecasts that often have large variance.
-
LEAD=integer
specifies the number of periods to forecast beyond the historical period defined by the SKIPFIRST= and BACK= options; for example, LEAD=10 results in the forecasting of 10 future values of the response series. By default, LEAD=12.
-
OUTFOR=libref.data-table
specifies an output SAS table for the forecasts. The output SAS table contains the ID variable, the response and predictor series, the one-step-ahead and out-of-sample response series forecasts, the forecast confidence intervals, the smoothed values of the response series, and the smoothed forecasts produced as a result of the model-based decomposition of the series. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs.
-
PLOT=plot-request
PLOT=( <plot-request> …<plot-request> )
-
produces forecast and model decomposition plots. You can specify the following plot-requests:
-
DECOMP
produces smoothed decomposition plots.
-
DECOMPVAR
produces plots of the variance of smoothed decomposition.
-
FDECOMP
produces filtered decomposition plots.
-
FDECOMPVAR
produces plots of the variance of filtered decomposition.
-
FORECASTS
produces a plot of series forecasts.
-
TREND
produces a plot of smoothed trend.
By default, a plot of multistep-ahead series forecasts in the post-sample region is produced.
-
PRINT=print-request
PRINT=( <print-request> …<print-request> )
-
controls the printing of the series forecasts and the printing of smoothed model decomposition estimates. By default, the series forecasts are printed only for the forecast horizon that you specify in the LEAD= option; that is, the one-step-ahead predicted values are not printed. You can specify the following print-requests:
-
DECOMP
prints smoothed estimates of the trend, the trend plus regression, the trend plus regression plus cycle, and the sum of all components except the irregular.
-
FDECOMP
prints filtered estimates of the trend, the trend plus regression, the trend plus regression plus cycle, and the sum of all components except the irregular.
-
FORECASTS
prints forecasts for the entire forecast span.
-
NONE
suppress the printing of all the forecast output.
By default, a table of multistep-ahead series forecasts in the post-sample region is produced.
-
SKIPFIRST=integer
specifies that an early portion of the data needs to be ignored during the forecasting calculations. This can be useful if there is a reason to believe that the model that you are using for forecasting is not appropriate for this portion of the data. If you specify an integer value of 10, the first 10 measurements of the response series are skipped during the forecasting calculations. By default, SKIPFIRST=0.