# Testing Restrictions on Beta (long run coefficients), R example

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)

vecm <- cajorls(jcointt,r=4)
summary(vecm$rlm) print(vecm)  I want to re-estimate the model with the following restrictions put on the coinegrating 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 c1 c2 c3 c4  here, b1.1 through to b4.1 are the coefficients ($\beta_1, \beta_2, \beta_3, \beta_4 $) of the first cointegrating vector. Similarly, b4.4 and c4 are coefficients of the fourth cointegrating equation. Then, in order to test the restrictions on Coinegrating Vectors, I run the following code: test <- blrtest(jcointt,H=H1,r=4)  However, I do not know how I should specify the H1 matrix in this instance. I was wondering if someone could demonstrate how I should go ahead with testing the restrictions on long run equations and then re-estimate the model using the above restrictions: vecm2 <- cajorls(test,r=4) summary(vecm2$rlm)
print(vecm2)

• Have you checked Pfaff "Analysis of Integrated and Cointegrated Time Series" (2008)? There are a few examples on p. 139-140 and around. You might need to use bh5lrtest or another function instead of blrtest. – Richard Hardy Oct 12 '15 at 19:15
• Just to clarify, I need to re-parameterize the first co-integrating equation through imposing restrictions. This requires, first, to impose the restrictions and to run the likelihood ratio test and then, if accepted, to estimate the restricted VAR whereby ect1 will have the new parameter values with a normalisation on the first variable. What I am not sure about is the $H$ matrix in the blrtest, how should I specify this so that I have the right restrictions imposed correctly. – mr.rox Oct 13 '15 at 10:26