The code given below estimates a VEC model with 4 cointegrating vectors. It is a reproducible code, so just copy and paste into your R console (or script editor).
nobs = 200
e = rmvnorm(n=nobs,sigma=diag(c(.5,.5,.5,.5,.5)))
e1.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,1])
e2.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,2])
e3.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,3])
e4.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,4])
y5 = cumsum(e[,5])
y1 = y5 + e1.ar1
y2 = y5 + e2.ar1
y3 = y5 + e3.ar1
y4 = y5 + e4.ar1
data = cbind(y1,y2,y3,y4,y5)
jcointt = ca.jo(data,ecdet="const",type="trace",K=2,spec="transitory")
summary(jcointt)
I went ahead with four cointegrating vectors and estimated a VECM:
vecm <- cajorls(jcointt,r=4)
summary(vecm$rlm)
print(vecm)
Here are the estimated cointegrating vectors:
$beta
ect1 ect2 ect3 ect4
y1.l1 1 0 0 0
y2.l1 0 1 0 0
y3.l1 0 0 1 0
y4.l1 0 0 0 1
y5.l1 -1.07 -1.05 -0.985 -1.05
constant -0.16 0.505 -0.05 0.116
Now, I would like to impose restrictions on the first cointegrating vector (on ect1
parameters) so that I can analyse the long run relationship between the variables. Here is what I want to obtain after imposing and reparameterising the cointegrating vectors:
ect1 ect2 ect3 ect4
y1.l1 1 0 0 0
y2.l1 b1.1 1 0 0
y3.l1 b2.1 0 1 0
y4.l1 b3.1 0 0 1
y5.l1 b4.1 b4.2 b4.3 b4.4
constant b0.1 b0.2 b0.3 b0.4
here, b1.1 through to b0.1 are the coefficients ($\beta_1,\beta_2,\beta_3,\beta_4$) of the first cointegrating vector labelled as ect1
, which could now be written as $y_{1,t-1}=\beta_0-\beta_1y_{2,t-1}-\beta_2y_{3,t-1}-\beta_3y_{4,t-1}-\beta_4y_{5,t-1}$. Similarly, b4.2 and b0.2 are coefficients of the second cointegrating equation etc.
I was wondering if you could help proceed further in imposing the restrictions and re-estimating the VECM with the restrictions. urca
package has a bltest()
, bh6lrtest()
, and bh5lrtest()
functions to test restrictions on cointegrating vectors, though, I need some guidance on how to construct my H
matrix (restrictions matrix) Thanks.