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!