VARMAX Procedure

Example 42.3 Analysis of Restricted Cointegrated Systems

(View the complete code for this example.)

The structural relationships between economic time series have been of interest for decades. Because of the cointegration, the vector error correction model (VECM), introduced by Engle and Granger (1987), is one of the most important tools for performing such analysis. Although there exist analytical solutions for a nonrestricted VECM and some restricted VECMs in special forms, the estimation of a generally restricted VECM relies on numerical methods. This section illustrates how to use the RESTRICT (or BOUND) and TEST statements, together with the COINTEG statement, to estimate the restricted VECM and perform the statistical tests. For more information about this topic, see Boswijk and Doornik (2004) and references therein.

The data are simulated based on the VECM,

StartLayout 1st Row 1st Column normal upper Delta bold y Subscript t 2nd Column equals 3rd Column bold-italic alpha bold-italic beta prime bold y Subscript t minus 1 plus normal upper Phi 1 Superscript asterisk Baseline normal upper Delta bold y Subscript t minus 1 plus normal upper Theta 0 Superscript asterisk Baseline bold x Subscript t plus bold-italic epsilon Subscript t 2nd Row 1st Column Blank 2nd Column equals 3rd Column Start 4 By 2 Matrix 1st Row 1st Column 0.01 2nd Column negative 0.02 2nd Row 1st Column negative 0.03 2nd Column 0.04 3rd Row 1st Column 0.05 2nd Column negative 0.06 4th Row 1st Column 0 2nd Column 0 EndMatrix Start 2 By 4 Matrix 1st Row 1st Column 1 2nd Column 0 3rd Column negative 1 4th Column 0 2nd Row 1st Column 0 2nd Column 1 3rd Column 0 4th Column negative 1 EndMatrix bold y Subscript t minus 1 3rd Row 1st Column Blank 2nd Column Blank 3rd Column plus Start 4 By 4 Matrix 1st Row 1st Column negative 0.01 2nd Column 0.03 3rd Column 0.05 4th Column negative 0.02 2nd Row 1st Column 0.02 2nd Column negative 0.04 3rd Column 0.06 4th Column 0.03 3rd Row 1st Column 0 2nd Column 0 3rd Column 0.10 4th Column 0 4th Row 1st Column 0 2nd Column 0 3rd Column 0 4th Column 0.04 EndMatrix normal upper Delta bold y Subscript t minus 1 Baseline plus Start 4 By 1 Matrix 1st Row  0 2nd Row  0 3rd Row  0 4th Row  0 EndMatrix bold x Subscript t Baseline plus bold-italic epsilon Subscript t Baseline comma 4th Row 1st Column bold-italic epsilon Subscript t 2nd Column tilde 3rd Column normal i normal i normal d upper N left-parenthesis 0 comma normal upper Sigma right-parenthesis comma normal upper Sigma equals upper I 4 EndLayout

where upper I 4 is the 4 times 4 identity matrix.

The following statements implement the simulation:

title 'Analysis of Restricted Cointegrated Systems';
proc iml;
   alpha = {0.01 -0.02, -0.03 0.04, 0.05 -0.06, 0 0};
   beta = {1 0, 0 1, -1 0, 0 -1};
   phiStar = {-0.01  0.03 0.05 -0.02,
               0.02 -0.04 0.06  0.03,
                  0     0 0.10     0,
                  0     0    0  0.04};
   Pi = alpha * beta` ;
   A1 = I(4) + Pi+ phiStar;
   A2 = -phiStar;
   phi = A1 // A2;
   sig = I(4);

   /* to simulate the vector time series */
   T = 600;
   myseed = 2;
   call varmasim(y,phi) sigma=sig n=T seed=myseed;
   x = J(T,1,0);
   do i = 1 to T;
      x[i] = normal(myseed);
   end;
   y = y || x;

   cn = {'y1' 'y2' 'y3' 'y4' 'x'};
   create simul5 from y[colname=cn];
   append from y;
   close;
quit;

Weak Exogeneity Tests

This example shows different methods for checking weak exogeneity.

The first method uses the EXOGENEITY option in the following statements, and the test results are shown in Output 42.3.1:

/* Method 1 -- To use the EXOGENEITY option */
ods output LogLikelihood = tbl_ll_g;
proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2 exogeneity;
run;

Output 42.3.1: Test Weak Exogeneity with the EXOGENEITY Option

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing Weak Exogeneity of
Each Variable
Variable DF Chi-Square Pr > ChiSq
y1 2 102.96 <.0001
y2 2 116.12 <.0001
y3 2 200.80 <.0001
y4 2 3.99 0.1357


The second method uses the RESTRICT statement and then the likelihood ratio (LR) test in the following statements. The results are shown in Output 42.3.2. In theory, the first and second methods should have exactly same statistics and p-values because they implement the same LR tests. However, because of the difference between the analytical solution and the numerical solution for the restricted VECM, the statistics are a little different, although for the 0.05 significance level they lead to the same correct conclusion: the variable y Baseline 1 is not the weak exogeneity of variables y Baseline 2, y Baseline 3, and y Baseline 4; the variable y Baseline 2 is not the weak exogeneity of variables y Baseline 1, y Baseline 3, and y Baseline 4; the variable y Baseline 3 is not the weak exogeneity of variables y Baseline 1, y Baseline 2, and y Baseline 4; the variable y Baseline 4 is the weak exogeneity of variables y Baseline 1, y Baseline 2, and y Baseline 3.

/* Method 2 -- Use the RESTRICT statement and implement LR test */
%macro LRTestForVECM();
   %do i = 1 %to 4;
      ods output LogLikelihood = tbl_ll_r1_&i.;
      proc varmax data=simul5;
         model y1 y2 y3 y4 = x / noint p=2;
         cointeg rank=2;
         restrict alpha(&i.,1:2) = 0;
      run;
   %end;
   proc iml;
      use tbl_ll_g;
      read all var {nValue1} into ll_g;
      close;
      %do i = 1 %to 4;
         use tbl_ll_r1_&i.;
         read all var {nValue1} into ll_r_&i.;
         close;
      %end;
      DF = J(4,1,2);
      ll_r = ll_r_1 // ll_r_2 // ll_r_3 // ll_r_4;
      Stat = -2*(ll_r - ll_g);
      pValue = 1-cdf("CHISQUARE", Stat, DF);
      Test =  {"H0: Alpha(1,)=0"} // {"H0: Alpha(2,)=0"}
           // {"H0: Alpha(3,)=0"} // {"H0: Alpha(4,)=0"};
      print  Test DF Stat pValue;
   quit;
%mend;
%LRTestForVECM();

Output 42.3.2: Test Weak Exogeneity with the RESTRICT Statement and LR Tests

Analysis of Restricted Cointegrated Systems

Test DF Stat pValue
H0: Alpha(1,)=0 2 109.05157 0
H0: Alpha(2,)=0 2 124.56535 0
H0: Alpha(3,)=0 2 238.35505 0
H0: Alpha(4,)=0 2 5.0877698 0.0785606


The third method uses the TEST statement, which implements the Wald tests. Asymptotically, the Wald test has the same distribution as the LR test.

/* Method 3 -- To use the TEST statement and the Wald test */
proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   test alpha(1,1:2) = 0;
   test alpha(2,1:2) = 0;
   test alpha(3,1:2) = 0;
   test alpha(4,1:2) = 0;
run;

Based on the test results shown in Output 42.3.3, the same correct conclusion can be obtained at the 0.05 significance level: the variable y Baseline 1 is not the weak exogeneity of variables y Baseline 2, y Baseline 3, and y Baseline 4; the variable y Baseline 2 is not the weak exogeneity of variables y Baseline 1, y Baseline 3, and y Baseline 4; the variable y Baseline 3 is not the weak exogeneity of variables y Baseline 1, y Baseline 2, and y Baseline 4; the variable y Baseline 4 is the weak exogeneity of variables y Baseline 1, y Baseline 2, and y Baseline 3.

Output 42.3.3: Test Weak Exogeneity with the TEST Statement, Wald Tests

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing of the Parameters
Test DF Chi-Square Pr > ChiSq
1 2 113.27 <.0001
2 2 129.15 <.0001
3 2 245.21 <.0001
4 2 4.81 0.0903


Identification

This example shows how important it is to identify bold-italic alpha and bold-italic beta when applying the Wald test on bold-italic alpha. First, in the following statements, there are no constraints on bold-italic beta:

proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   test alpha(1,2) = alpha(2,2) + alpha(3,2);
run;

As shown in Output 42.3.4, based on the test results, the null hypothesis H0: bold-italic alpha left-bracket 1 comma 2 right-bracket equals bold-italic alpha left-bracket 2 comma 2 right-bracket plus bold-italic alpha left-bracket 3 comma 2 right-bracket should be rejected at the 0.05 significance level, although the true parameter values for the data generating process indicate that H0 is correct.

Output 42.3.4: Importance of Identifying bold-italic alpha and bold-italic beta in the Wald Test

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing of the Parameters
Test DF Chi-Square Pr > ChiSq
1 1 21.44 <.0001


In the following statements, r squared constraints are now imposed on bold-italic beta, where r is the cointegration rank:

proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   restrict beta(3:4,1:2) = -I(2);
   test alpha(1,2) = alpha(2,2) + alpha(3,2);
run;

As shown in Output 42.3.5, the null hypothesis cannot be rejected at 0.05 significance level; that is to say, the correct conclusion is achieved.

Output 42.3.5: Importance of Identifying bold-italic alpha and bold-italic beta in the Wald Test, Continued

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing of the Parameters
Test DF Chi-Square Pr > ChiSq
1 1 0.16 0.6869


Besides bold-italic alpha, other short-run parameters in a VECM can also be tested by using the TEST statement. Because short-run parameters other than bold-italic alpha are identified in a VECM, it is not necessary to impose additional constraints on bold-italic alpha and bold-italic beta. The following statements test the null hypothesis H0: normal upper Phi 1 Superscript asterisk Baseline equals 0:

proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   test ar(2);
run;

According to the results shown in Output 42.3.6, the null hypothesis should be rejected at the 0.05 significance level.

Output 42.3.6: Wald Tests for Short-Run Parameters

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing of the Parameters
Test DF Chi-Square Pr > ChiSq
1 16 32.79 0.0079


The following statements test the null hypothesis H0: normal upper Theta 0 Superscript asterisk Baseline equals 0:

proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   test xl;
run;

According to the results shown in Output 42.3.7, the null hypothesis cannot be rejected at the 0.05 significance level.

Output 42.3.7: Wald Tests for Short-Run Parameters, Continued

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing of the Parameters
Test DF Chi-Square Pr > ChiSq
1 4 6.01 0.1982


Besides the parameters that are estimated in a VECM, you can also use the TEST statement on normal upper Pi left-parenthesis equals bold-italic alpha bold-italic beta prime right-parenthesis, and bold-italic delta 0 or bold-italic delta 1 for Case 2 or 4 when the constant or linear trend, respectively, is restricted in the error correction term. However, keep in mind that the covariance matrix for these parameter estimates is singular when the cointegration rank is less than the number of dependent variables; hence, you might not get the results for some tests.

proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   test ar(1,4,1:4);
   test ar(1,4,{1 3});
run;

As shown in Output 42.3.8, the first test on H0: normal upper Pi left-bracket 4 comma right-bracket equals 0 cannot be calculated, whereas the second test on H0: normal upper Pi left-bracket 4 comma 1 right-bracket equals normal upper Pi left-bracket 4 comma 3 right-bracket equals 0 can be.

Output 42.3.8: Wald Tests for normal upper Pi

Analysis of Restricted Cointegrated Systems

The VARMAX Procedure

Testing of the Parameters
Test DF Chi-Square Pr > ChiSq
1 4    
2 2 4.81 0.0903


Tests for Long-Run Parameter

This example focuses on testing the relationships on the long-run parameter bold-italic beta. Here, only the following specific form of hypothesis is discussed,

normal upper H Baseline 0 colon bold-italic beta equals left-parenthesis bold upper H comma bold-italic phi right-parenthesis

where bold upper H is a known k times r 1 matrix, bold-italic phi is a freely varying k times left-parenthesis r minus r 1 right-parenthesis parameter matrix, k is the number of dependent variables, r is the cointegration rank, and 0 less-than-or-equal-to r 1 less-than-or-equal-to r. Other forms of hypothesis—for example, H0: bold-italic beta equals left-parenthesis bold upper H 1 bold-italic phi 1 comma ellipsis comma bold upper H Subscript r Baseline bold-italic phi Subscript r Baseline right-parenthesis or H0: bold upper H normal v normal e normal c left-parenthesis bold-italic beta right-parenthesis equals bold h—are omitted, although they can also be implemented in the same logic. The following statements test the null hypothesis that left-parenthesis 1 0 negative 1 0 right-parenthesis prime is in the cointegrating space that is spanned by bold-italic beta:

/* Use the RESTRICT statement and LR test for restrictions on Beta. */
/* H0: Beta = [ H, phi ] where H is known and phi is free */
ods output LogLikelihood = tbl_ll_r2;
proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   restrict beta(,1) = {1, 0, -1, 0};
   nloptions tech=qn maxit=5000;
run;

proc iml;
   use tbl_ll_g;
   read all var {nValue1} into ll_g;
   close;
   use tbl_ll_r2;
   read all var {nValue1} into ll_r;
   close;
   DF = (4-2)*1; /* DF = (k-r)*r_1 */
   Stat = -2*(ll_r - ll_g);
   pValue = 1-cdf("CHISQUARE", stat, df);
   Test = "H0: Beta[1,1:4] = {1 0 -1 0}'";
   print  Test DF Stat pValue;
quit;

According to the result shown in Output 42.3.9, the null hypothesis cannot be rejected at the 0.05 significance level.

Output 42.3.9: LR Tests on Long-Run Parameter bold-italic beta

Analysis of Restricted Cointegrated Systems

Test DF Stat pValue
H0: Beta[1,1:4] = {1 0 -1 0}' 2 1.6194924 0.444971


The following statements test the null hypothesis that the cointegrating space is spanned by

left-parenthesis 1 0 negative 1 0 comma 0 1 0 negative 1 right-parenthesis prime:

/* H0: Beta = H, where H is the true Beta for DGP */
ods output LogLikelihood = tbl_ll_r3;
proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   restrict beta = I(2) // (-I(2));
   nloptions tech=qn maxit=5000;
run;

proc iml;
   use tbl_ll_g;
   read all var {nValue1} into ll_g;
   close;
   use tbl_ll_r3;
   read all var {nValue1} into ll_r;
   close;
   DF = (4-2)*2; /* DF = (k-r)*r_1 */
   Stat = -2*(ll_r - ll_g);
   pValue = 1-cdf("CHISQUARE", stat, df);
   Test = "H0: Beta = {1 0, 0 1, -1 0, 0 -1}";
   print  Test DF Stat pValue;
quit;

According to the result shown in Output 42.3.10, the null hypothesis cannot be rejected at the 0.05 significance level.

Output 42.3.10: LR Tests on Long-Run Parameter bold-italic beta, Continued

Analysis of Restricted Cointegrated Systems

Test DF Stat pValue
H0: Beta = {1 0, 0 1, -1 0, 0 -1} 4 1.5815435 0.8121055


The following statements test the null hypothesis that the cointegrating space is spanned by left-parenthesis 1 0 1 0 comma 0 1 0 1 right-parenthesis prime, the orthogonal matrix to the true bold-italic beta for the data generating process:

/* H0: Beta = H, where H is the matrix orthogonal
       to the true Beta for DGP */
ods output LogLikelihood = tbl_ll_r4;
proc varmax data=simul5;
   model y1 y2 y3 y4 = x / noint p=2;
   cointeg rank=2;
   restrict beta = {1 0, 0 1, 1 0, 0 1};
   nloptions tech=qn maxit=5000;
run;

proc iml;
   use tbl_ll_g;
   read all var {nValue1} into ll_g;
   close;
   use tbl_ll_r4;
   read all var {nValue1} into ll_r;
   close;
   DF = (4-2)*2; /* DF = (k-r)*r_1 */
   Stat = -2*(ll_r - ll_g);
   pValue = 1-cdf("CHISQUARE", stat, df);
   Test = "H0: Beta = {1 0, 0 1, 1 0, 0 1}";
   print  Test DF Stat pValue;
quit;

According to the result shown in Output 42.3.11, the null hypothesis should be rejected at the 0.05 significance level.

Output 42.3.11: LR Tests on Long-Run Parameter bold-italic beta, Continued

Analysis of Restricted Cointegrated Systems

Test DF Stat pValue
H0: Beta = {1 0, 0 1, 1 0, 0 1} 4 227.68902 0


For the VECM, the BOUND statement can be regarded as an alias of the RESTRICT statement; that is, you can directly replace any RESTRICT statement with a BOUND statement and get the same result. The linear inequality constraints in the restricted cointegrated systems are not discussed in this section, although they are also supported in the BOUND and RESTRICT statements. For more information, see the sections BOUND Statement and RESTRICT Statement.

Obtaining the numerical solution for the restricted VECM is not an easy task in most cases. You might need to use the INITIAL and NLOPTIONS statements to tune the process. For more information, see the sections INITIAL Statement and NLOPTIONS Statement.

Last updated: June 19, 2025