BookmarkSubscribeRSS Feed
su17
Calcite | Level 5

I am looking to generate ex post forecasts from an ADL(1,1) model. So after the first observation the lagged dependent variable value is not the prior period actual value but rather the prior period predicted value. And this is carried on over the forecast horizon. I do not see that as possible using a SAS procedure (e.g., AUTOREG) so I think this has to be separate coding exercise/macro. Any help anyone can share would be greatly appreciated. Say I have a ADL model with two X variables and one period lags. Thanks.

1 REPLY 1
dw_sas
SAS Employee

Hi @su17 , 

 

If you have already used PROC AUTOREG to estimate your model, then one approach you can use to compute forecasts as you described is PROC SIMLIN.  (This is an old procedure, but useful for this case!)  A second approach is to use PROC MODEL to estimate the model parameters and compute the simulated values in one step.  The OUT= data sets produced by these two procedures are structured differently, but the results should be the same for your linear model.  Both approaches are illustrated in the syntax below:

 

  /* Approach 1 */
proc autoreg data=a outest=est;
  model y=lag_y lag_x1 lag_x2;
run;

proc simlin data=a est=est start=2;
  endo y;
  exog lag_x1 lag_x2;
  lagged lag_y y 1;
  output out=simlin_out p=expost;
run;

proc print data=simlin_out;
run;

  /* Approach 2 */
proc model data=a;
  endo y;
  exog x1 x2;
  parms b0 a b1 b2;
  y = b0 + a*lag(y) + b1*lag(x1) + b2*lag(x2);
  fit y / outest=mod_est;
  solve y / estdata=mod_est start=1 out=model_out outactual outpredict;
run;
quit;

proc print data=model_out;
run;

If the approaches described above do not produce your desired results, then please provide an example which illustrates your model and expected results.  

 

I hope this helps!

DW

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Discussion stats
  • 1 reply
  • 1185 views
  • 1 like
  • 2 in conversation