Johansen cointegration test
[h,pValue,stat,cValue,mles] = jcitest(Y,Name,Value)
Johansen tests assess the null hypothesis H(r) of
cointegration rank less than or equal to r among
numDims-dimensional time series in
or H(r+1) (
The tests also produce maximum likelihood estimates of the parameters
in a vector error-correction (VEC) model of the cointegrated series.
Specify optional comma-separated pairs of
Name is the argument
Value is the corresponding
Name must appear
inside single quotes (
You can specify several name and value pair
arguments in any order as
String or cell vector of strings specifying the form of the deterministic components of the VEC(q) model of yt:
If r <
Deterministic terms outside of the cointegrating relations, c1 and d1, are identified by projecting constant and linear regression coefficients, respectively, onto the orthogonal complement of A.
Scalar or vector of nonnegative integers indicating the number q of lagged differences in the VEC(q) model of yt.
Lagging and differencing a time series reduce the sample size. Absent any presample values, if yt is defined for t = 1:N, then the lagged series yt−k is defined for t = k + 1:N. Differencing reduces the time base to k+2:N. With q lagged differences, the common time base is q+2:N and the effective sample size is T = N−(q+1).
String or cell vector of strings indicating the type of test
to be performed. Values are
Scalar or vector of nominal significance levels for the tests. Values must be between 0.001 and 0.999.
String or cell vector of strings indicating whether or not to display a summary of test results and parameter estimates in the Command Window.
Scalar or single string values are expanded to the length of any vector value (the number of tests). Vector values must have equal length.
Load data on term structure of interest rates in Canada:
load Data_Canada Y = Data(:,3:end); names = series(3:end); plot(dates,Y) legend(names,'location','NW') grid on
Test for cointegration:
[h,pValue,stat,cValue,mles] = jcitest(Y,'model','H1'); h,pValue
************************ Results Summary (Test 1) Data: Y Effective sample size: 40 Model: H1 Lags: 0 Statistic: trace Significance level: 0.05 r h stat cValue pValue eigVal ---------------------------------------- 0 1 37.6886 29.7976 0.0050 0.4101 1 1 16.5770 15.4948 0.0343 0.2842 2 0 3.2003 3.8415 0.0737 0.0769 h = r0 r1 r2 _____ _____ _____ t1 true true false pValue = r0 r1 r2 _________ ________ ________ t1 0.0050497 0.034294 0.073661
Plot estimated cointegrating relations :
YLag = Y(2:end,:); T = size(YLag,1); B = mles.r2.paramVals.B; c0 = mles.r2.paramVals.c0; plot(dates(2:end),YLag*B+repmat(c0',T,1)) grid on
Time series in
Y might be stationary in
levels or first differences (i.e., I(0) or I(1)).
Rather than pretesting series for unit roots (using, e.g.,
the Johansen procedure formulates the question within the model. An I(0)
series is associated with a standard unit vector in the space of cointegrating
relations, and its presence can be tested using
jcitest fails to reject the null of
cointegration rank r = 0,
the inference is that the error-correction coefficient C is
zero, and the VEC(q) model reduces to a standard
VAR(q) model in first differences. If
all cointegration ranks r less than
the inference is that C has full rank, and yt is
stationary in levels.
The parameters A and B in
the reduced-rank VEC(q) model are not uniquely
identified, though their product C = AB′ is.
using the orthonormal eigenvectors
V returned by
eig, then renormalizes so that
= I, as in .
To test linear constraints on the error-correction speeds A and
the space of cointegrating relations spanned by B,
 Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
 Johansen, S. Likelihood-Based Inference in Cointegrated Vector Autoregressive Models. Oxford: Oxford University Press, 1995.
 MacKinnon, J. G., A. A. Haug, and L. Michelis. "Numerical Distribution Functions of Likelihood Ratio Tests for Cointegration." Journal of Applied Econometrics. v. 14, 1999, pp. 563–577.
 Turner, P. M. "Testing for Cointegration Using the Johansen Approach: Are We Using the Correct Critical Values?" Journal of Applied Econometrics. v. 24, 2009, pp. 825–831.