BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
supmilk
Obsidian | Level 7

Hello,

 

As forecast procedure say, "The FORECAST statement generates forecast values for a time series by using the parameter estimates produced by the previous ESTIMATE statement. See the section Forecasting Details for more information about calculating forecasts.", FORECAST in Proc Arima is in-sample prediction?

 

If it is, how can I do out-sample prediction? Does SAS provide a proc to do the out-sample prediction?

 
1 ACCEPTED SOLUTION

Accepted Solutions
rselukar
SAS Employee

PROC ARIMA can produce one-step-ahead forecasts within sample (i.e. for time points t in the historical period you can get forecast at time (t+1) using the data up to time t) and multi-step-ahead forecasts after the history ends (i.e., out-of-sample). Please see "Example 7.2 Seasonal Model for the Airline Series" for an example and go over the syntax of the FORECAST statement for the details of lead= and back= options.  If your model contains predictor variables, the values of these variables must be available in the forecast region to produce the forecasts of the response variable.

View solution in original post

7 REPLIES 7
Rick_SAS
SAS Super FREQ

Typically an "in-sample prediction" means that you want the predicted value at an observation that was used to fit the model. An "out-of-sample prediction" means that you are evaluating the model at a time value that was not in the data. Using this definition, forecasts are usually out-of-sample because you are predicting future values.

 

If this is not the definition that you are using, please explain what you mean.

supmilk
Obsidian | Level 7

yes, exactly as you said, so forecast in proc arima is out-sample?

rselukar
SAS Employee

PROC ARIMA can produce one-step-ahead forecasts within sample (i.e. for time points t in the historical period you can get forecast at time (t+1) using the data up to time t) and multi-step-ahead forecasts after the history ends (i.e., out-of-sample). Please see "Example 7.2 Seasonal Model for the Airline Series" for an example and go over the syntax of the FORECAST statement for the details of lead= and back= options.  If your model contains predictor variables, the values of these variables must be available in the forecast region to produce the forecasts of the response variable.

supmilk
Obsidian | Level 7

Thanks a lot for your help!

supmilk
Obsidian | Level 7

I have checked the results of the forecast again, It seems that the forecast with options lead= and back= cannot provide the out-of-sample forecast. ''Out-of-sample" forecast means that at every time point t, we forecast the value of time t+1 only using the information based on the time t. But the arima proc uses the information of all the observations at all time (the parameters are evaluated based on all the observations).

 

Am I right? If right, does SAS provide any solution to do the out-of-sample forecast?

rselukar
SAS Employee

I am not sure why you want forecast at time t+1 to be based only on data at time t.  Only for very simple models such as random walk model, such a forecast will be optimal.  In most situations forecast at time t+1 is a function of all the available data (i.e. all history up to time t).  PROC ARIMA provides in-sample and out-of-sample (multi-step ahead) forecasts as described standard ARIMA texts such as Box and Jenkins or Brockwell and Davis.  Your comment about parameter estimates is also unclear.  Estimating parameters using all data is also a standard practice.

supmilk
Obsidian | Level 7

Actually, you cannot get all the information (the data of time [0,T]) at time t. If you want to forecst t+1, you can only do the forecast using the model based on the data of time [0,t]. If you do the forecast at any time t using the full data [0,T], it is a in-sample forecast. It is meaningless for the realistic world but only for academic research.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 2273 views
  • 3 likes
  • 3 in conversation