Wednesday, April 12, 2017

The Engle-Granger cointegration approach

The two steps of Engle-Granger’s approach to cointegration, in case of two time series yt, xt, are:

1st step:
Test for integration order of both variables (as it is condition for cointegration that all variables are integrated of same order I(d)). This is achieved  (for instance) via the Augmented Dickey-Fuller test (any of the three variants can be used, according to judgment). If both variables are integrated of same order, least square regression cointegrating model can be estimated:
The residuals t are then tested for stationarity (Augmented Dickey-Fuller test without drift and without trend,  however since residuals are themselves estimates, the MacKinnon critical values have to be used). If time series of residuals is found stationary, the two time series are said to be cointegrated .


2nd step:
Estimate error correction model with residuals t (from step 1). As the estimate of β̂ is superconsistent, the residuals can be considered to be “known” and then ordinary least square applies:


An example in R code (taken from Bernhard Pfaff: Tutorial - Analysis of Integrated and Cointegrated Time Series) :




set.seed(12345)
e1 <- rnorm(250, mean = 0, sd = 0.5)
e2 <- rnorm(250, mean = 0, sd = 0.5)
u.ar3 <- arima.sim(model = list(ar = c(0.6, -0.2, 0.1)), n = 250, innov = e1)
y2 <- cumsum(e2)
y1 <- u.ar3 + 0.5*y2
ymax <- max(c(y1, y2))
ymin <- min(c(y1, y2))
layout(matrix(1:2, nrow = 2, ncol = 1))
plot(y1, xlab = "", ylab = "", ylim =c(ymin, ymax), main ="Cointegrated System")
lines(y2, col = "green")
plot(u.ar3, ylab = "", xlab = "", main = "Cointegrating Residuals")
abline(h = 0, col = "red")
lr <- lm(y1 ~ y2)
ect <- resid(lr)[1:249]
dy1 <- diff(y1)
dy2 <- diff(y2)
ecmdat <- cbind(dy1, dy2, ect)
ecm <- dynlm(dy1 ~ L(ect, 1) + L(dy1, 1)+ L(dy2, 1) , data = ecmdat)

No comments:

Post a Comment