Skip to contents

Native Johansen (1988, 1991) reduced-rank regression on a VECM with K = max(k_ar_diff + 1, 2) lags in levels, an unrestricted constant (ecdet = "none") and the long-run parameterisation. Computed with rmorie's own code, which reproduces urca::ca.jo(x, type = "trace", ecdet = "none", K = max(k_ar_diff + 1, 2)) (statistics, eigenvalues and normalised eigenvectors) to rounding error; no external package is used. Critical values are the Osterwald-Lenum (1992) table used by urca (available for up to 11 series).

Usage

morie_johansen_cointegration(x, k_ar_diff = 1)

Arguments

x

Numeric matrix (T x k) of I(1) candidate series.

k_ar_diff

Number of lagged differences. Default 1.

Value

Named list with eigenvalues, trace_stat, crit_values, rank, n, k, method. trace_stat and the rows of crit_values (columns 10pct, 5pct, 1pct) are ordered as in urca: H0 \(r \le k-1\) first, \(r = 0\) last; rank is the number of trace statistics exceeding their 5 percent critical value. The list carries an attribute "johansen" holding the maximal-eigenvalue statistics (max_eigen_stat, max_eigen_crit), the eigenvectors normalised on the first variable (eigenvectors, urca's V) and unnormalised (eigenvectors_raw, urca's Vorg), the loading matrix W, PI, and the lag order K.

References

Johansen, S. (1988). Statistical analysis of cointegration vectors. Journal of Economic Dynamics and Control 12, 231-254. Osterwald-Lenum, M. (1992). Oxford Bulletin of Economics and Statistics 54, 461-472.

Examples

set.seed(1)
w <- cumsum(rnorm(100))
Y <- cbind(w + rnorm(100), 0.5 * w + rnorm(100))
morie_johansen_cointegration(Y)$trace_stat
#> [1]  2.535219 52.502007