BookmarkSubscribeRSS Feed
SAScph
Fluorite | Level 6

Hi

 

I want to know what the difference is when inserting variables in proc reg and then forecast the residuals with VARMAX 

and

inserting the significant variables from proc reg to the VARMAX modelling.

 

In code:

Proc reg data=x printall;
dependent_variable=exogenous_variable1 exogenous_variable2 ... exogenous_variablep
white vif tol dw dwprob selection=b slentry=0.05;
output out=xforecast Rstudent=Rstudent student=student covratio=covratio h=h predicted=pred residual=residual;

Proc varmax data=xforecast
model residual/
p=7 q=2
method=ls dftest minic=(type=aic) print=(roots);
nloptions;
garch p=1 q=1 form=ccc;
output out=forecast1 lead=21;
run;

Or with only VARMAX:

proc varmax data=xforecast printall;
dependent_variable=exogenous_variable1 exogenous_variable2 ... exogenous_variablep/
p=7 q=2 method=ls dftest minic=(type=aic) print=(roots);
nloptions;
garch p=1 q=1 form=ccc;
output out=forecast1 lead=21;

With only running VARMAX it is also not possible to generate a forecast which i don't understand. The error code:

 WARNING: The value of LEAD=21 in OUTPUT statement. There are only 0 future independent observations. The value of LEAD will take 
          the minimum of two values.
5 REPLIES 5
SAS_Illyrian
Fluorite | Level 6
I'd like to get a clear answer on this too. This warning is driving me crazy. I can't find any explanations about this no the web.
SAS_Illyrian
Fluorite | Level 6
The "VARMAX Procedure" documentation has an explanation on this matter, as per the following paragraph:

"In the preceding state space form of a VARMAX model, the exogenous variables are treated as determined
terms, which implies that the values of the exogenous variables must be provided to forecast the out-of-sample
dependent variables. If you do not have the future values of the exogenous variables, either you predict the
exogenous variables in a separate model, or you express both the exogenous variables and the dependent
variables in one combined model and predict them together (Reinsel 1997)."
SAS_Illyrian
Fluorite | Level 6
However, I am unclear how to achieve the above with SAS code. Let's assume you have the values of the independent variables. How do you confine the dataset to make the model within sample, and get the forecast values out of sample?
SASCom1
SAS Employee

Hi @SAS_Illyrian 

When future values of exogenous variables are provided in the data set, PROC VARMAX computes future forecasts using those supplied values for the exogenous variables; when future values of the exogenous variables are not provided in the input data set, PROC VARMAX is expected to compute future forecasts for the exogenous variables using the same VAR/VMA/VARMA model specification(i.e., with the same p = and q = specification) for the dependent variables, then forecasts for the dependent variables are obtained using those forecasted exogenous variables for the future periods. This should be done automatically and you do not need to manually do anything additional. So the warning message you observed and that you do not get forecasts when future exogenous variables are not provided in PROC VARMAX may indicate some issues that need further investigation. Can you contact Technical Support at:

 

https://support.sas.com/en/technical-support.html#contact

 

and we will further look into this issue. Thanks.

 

SASCom1
SAS Employee

Hi @SAS_Illyrian 

We did some further investigation, and our test confirmed that:

(1). if you only specify P = option, and no Q = option is specified, then PROC VARMAX automatically forecasts future independent variables if they are not provided in the data set, using the same VAR model (the same order of P = option) for the dependent variables, then obtain forecast on the dependent variables using the thus forecasted independent variables for future periods ;

 

(2). if you specify Q = option(with or without P = option), then unfortunately the procedure does not automatically obtain forecasts if future independent variables are not provided in the data set, and issue the warning you observed in the log. This is a bug in the procedure and we are working on fix of this issue, so that in the future it will behave the same as when only p = is specified discussed in (1) above. 

 

In the mean time, if you want future forecasts in case (2) then you may need to first forecast future independent variables yourself and save the future forecasts on the independent variables, then append the future forecasts to the end of the data. Then you can run PROC VARMAX on the appended data set to obtain future forecasts on the dependent variables.

 

I hope this helps.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Discussion stats
  • 5 replies
  • 1113 views
  • 1 like
  • 3 in conversation