mrrox
2015-Oct-12 18:23 UTC
[R] Testing Restrictions on Beta (long-run coefficients), reproducible 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) # estimate VECM with 4 cointegrating vectors 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 (?1,?2,?3,?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) How should I specify the H1 matrix above in order to re-estimate the re-parameterised cointegrating equations? I want to use the coefficients of the first cointegrating equation (ect1) for inference. -- View this message in context: http://r.789695.n4.nabble.com/Testing-Restrictions-on-Beta-long-run-coefficients-reproducible-example-tp4713512.html Sent from the R help mailing list archive at Nabble.com.