0

I'm estimating a SVAR in R, but the A-B form results are very different than in Eviews, I'm not sure why it happened. Also, the option I think is right gives me error message. Could anyone help me? Here is the R code I'm using:

resA <- matrix(NA, nrow = 5, ncol = 5)
resA[2,4]=resA[2,5]=resA[3,4]=resA[3,5]=resA[4,2]=resA[4,3]=resA[4,5]=0
resA[5,2]=resA[5,3]=resA[5,4]=0
resA[1,1]=resA[2,2]=resA[3,3]=resA[4,4]=resA[5,5]=1
resA
model=VAR(vardata, p=2, type="const")
summary(model)
stt=matrix(0.1, nrow = 1, ncol = 10)
model1=SVAR(model, Amat=resA, lrtest=TRUE, estmethod="scoring", start=stt, conv.crit=0.0001, max.iter=500)
summary(model1)

irf.gap=irf(model1, impulse="gap", boot=FALSE, n.ahead=15, runs=100)
plot(irf.gap)

The problem is the last command IRF. It gives me reversed shape than Eviews. I'm think that since Eviews only mentions that it is using Cholesky Decomposition with df adjusted(this thing should be relevant to CI's) and "Response to Cholesky one S.D. Innovations +/- 2 S.E.", I guess the problem should be from the one SD and 2SE, still not sure how the R command "irf" does...

BTW, the package of R I'm using is library(vars), and for Eviews I used default setting for IRF.

Updated: the problem happened because command irf computes the structural impulse response function which is different from Eviews' Cholesky decomposition. Anyone would share any link with steps to manually compute Eviews version of IRF is really appreciated!

ZhiJie Fu
  • 1
  • 1
  • could you specify the package you are using please? It makes it easier to help. – DJJ Apr 12 '16 at 16:19
  • sry, the package is "library(vars)", actually, I figured out how to get rid of this error message, just delete Bmat=resB, and it will set identity matrix automatically, and gives no error. Also I basically get the same result from the model estimation "model1" to Eviews. The problem remaining is that the IRF from the command "irf(model1, impulse="gap", boot=FALSE, n.ahead=15, runs=100)" gives me very different views to Eviews, and I'm still searching on whether this command uses cholesky decomposition and one SD shock... – ZhiJie Fu Apr 12 '16 at 16:54
  • I usually don't use non free software as benchmark. I'm not sure you can see what eviews is doing anyway. A way of checking would be trying to reproduce the example of irf function in eviews to see how it goes. `example(irf)`. – DJJ Apr 12 '16 at 19:49

0 Answers0