Forecasting using SAS Forecast Server, SAS/ETS, and more

Vector Autoregression with parameter restriction

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

Vector Autoregression with parameter restriction

Hi all, 

I would like to run some Vector Autoregression with parameters restrictions. That is, I dont want to regress the dependent variable (Yt) on its lag but other independent variables are still regressed on their lags. Please see attached file for a matrix illustration. I only want 1 lag

 

I also would like to obtain the variance-covariance matrix of the error terms. My code so far:

proc varmax data=input_data;
   model Y = A B C/ P=1;
  * restrict AR(1, Y, {A B C}) = 0,
            XL(0, CPI, {FFR CP}) = 0; *not sure what this restrict option does as why do we set it to equal 0;
run;

 

VAR with parameter restriction.PNG


VAR with parameter restriction.PNG

Accepted Solutions
Solution
‎07-05-2017 08:49 PM
SAS Employee
Posts: 26

Re: Vector Autoregression with parameter restriction

Hi,

 

Based on the description of your model, you can obtain your desired result using the following PROC VARMAX specification:

 

proc varmax data=input_data;
   model y a b c / p=1 print=(estimates) ;
   restrict ar(1,1,1)=0, ar(1,2,1)=0, ar(1,3,1)=0, ar(1,4,1)=0;
run;

 

Since you want the variables, A, B and C, to also be regressed on their lags, they must appear on the left-hand-side of the equation.  

 

The output generated by PROC VARMAX includes a table labeled "Covariances of Innovations".  This is the variance-covariance matrix of the error terms, which you indicated that you also needed.  If you want to save this variance-covariance matrix as a SAS data set, then you can use an ODS OUTPUT statement to do so. 

 

Following, please find a modification of the above code, which illustrates the ODS OUTPUT statement and also provides a modified version of the RESTRICT statement.  The modified RESTRICT statement imposes the same restriction, but uses a more concise matrix expression.  A PROC PRINT step is added to print the ERROR_COV data set created from the ODS OUTPUT statement.

 

proc varmax data=input_data;
   ods output CovInnovation=error_cov;
   model y a b c / p=1 print=(estimates) ;
   restrict ar(1,{1,2,3,4},1)=0;
run;

proc print data=error_cov;
run;

 

I hope this helps!

DW

View solution in original post


All Replies
Solution
‎07-05-2017 08:49 PM
SAS Employee
Posts: 26

Re: Vector Autoregression with parameter restriction

Hi,

 

Based on the description of your model, you can obtain your desired result using the following PROC VARMAX specification:

 

proc varmax data=input_data;
   model y a b c / p=1 print=(estimates) ;
   restrict ar(1,1,1)=0, ar(1,2,1)=0, ar(1,3,1)=0, ar(1,4,1)=0;
run;

 

Since you want the variables, A, B and C, to also be regressed on their lags, they must appear on the left-hand-side of the equation.  

 

The output generated by PROC VARMAX includes a table labeled "Covariances of Innovations".  This is the variance-covariance matrix of the error terms, which you indicated that you also needed.  If you want to save this variance-covariance matrix as a SAS data set, then you can use an ODS OUTPUT statement to do so. 

 

Following, please find a modification of the above code, which illustrates the ODS OUTPUT statement and also provides a modified version of the RESTRICT statement.  The modified RESTRICT statement imposes the same restriction, but uses a more concise matrix expression.  A PROC PRINT step is added to print the ERROR_COV data set created from the ODS OUTPUT statement.

 

proc varmax data=input_data;
   ods output CovInnovation=error_cov;
   model y a b c / p=1 print=(estimates) ;
   restrict ar(1,{1,2,3,4},1)=0;
run;

proc print data=error_cov;
run;

 

I hope this helps!

DW

Occasional Contributor
Posts: 11

Re: Vector Autoregression with parameter restriction

Thanks, this works fine.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 197 views
  • 1 like
  • 2 in conversation