Main Content

Test for Cointegration Using the Johansen Test

This example shows how to assess whether a multivariate time series has multiple cointegrating relations using the Johansen test.

LoadData_Canadainto the MATLAB® Workspace. The data set contains the term structure of Canadian interest rates[141]. Extract the short-term, medium-term, and long-term interest rate series.

loadData_CanadaY =数据(:,3:结束);%的利率数据

To illustrate the input and output structure ofjcitestwhen conducting multiple tests, test for the cointegration rank using the default H1 model and two different lag structures.

[h,pValue,stat,cValue] = jcitest(Y,“模型”,'H1','Lags',1:2);
************************ Results Summary (Test 1) Data: Y Effective sample size: 39 Model: H1 Lags: 1 Statistic: trace Significance level: 0.05 r h stat cValue pValue eigVal ---------------------------------------- 0 1 35.3442 29.7976 0.0104 0.3979 1 1 15.5568 15.4948 0.0490 0.2757 2 0 2.9796 3.8415 0.0843 0.0736 ************************ Results Summary (Test 2) Data: Y Effective sample size: 38 Model: H1 Lags: 2 Statistic: trace Significance level: 0.05 r h stat cValue pValue eigVal ---------------------------------------- 0 0 25.8188 29.7976 0.1346 0.2839 1 0 13.1267 15.4948 0.1109 0.2377 2 0 2.8108 3.8415 0.0937 0.0713

The default "trace" test assesses null hypotheses H ( r ) of cointegration rank less than or equal toragainst the alternative H ( n ) , wherendat的尺寸吗a. The summaries show that the first test rejects a cointegration rank of 0 (no cointegration) and just barely rejects a cointegration rank of 1, but fails to reject a cointegration rank of 2. The inference is that the data exhibit 1 or 2 cointegrating relationships. With an additional lag in the model, the second test fails to reject any of the cointegration ranks, providing little by way of inference. It is important to determine a reasonable lag length for the VEC model (as well as the general form of the model) before testing for cointegration.

Because the Johansen method, by its nature, tests multiple rank specifications for each specification of the remaining model parameters,jcitestreturns the results in the form of tabular arrays, and indexes by null rank and test number.

Display the test results,h.

h
h=2×3 tabler0 r1 r2 _____ _____ _____ t1 true true false t2 false false false

Column headers indicate testsr0,r1, andr2, respectively, of H ( 0 ) , H ( 1 ) , and H ( 2 ) against H ( 3 ) . Row headerst1andt2indicate the two separate tests (two separate lag structures) specified by the input parameters.

Access the result for the second test at null rank r = 0 using tabular array indexing.

h20 = h.r0(2)
h20 =logical0

See Also

Related Examples

More About