# Direction of orthogonalization in the vars package in R

I could not find anything in the documentation of this package R vignette of vars package or anywhere else on the internet. In case one estimates orthogonalized impulse response functions, the ordering of the variables in the VAR system implicitly also determines the order of the orthogonalization. This means if I estimate a VAR with the variables X, Y, Z the impact in t=0 does only work from X -> Y -> Z, but not the other way round. Is this correct?

I guess you actually mean the irf function. For this it is important if the function uses the UPPER triangular form or the LOWER triangular form. You can look into the specific function by package:::\$functionname

vars:::.irf gives:

if ((class(x) == "varest") || (class(x) == "vec2var")) { if (ortho) { irf <- Psi(x, nstep = n.ahead) } else { irf <- Phi(x, nstep = n.ahead) } }

When you set ortho==TRUE then the function Psi is used. And vars:::Psi.varest shows:

P <- t(chol(sigma.u))

The chol() command in R gives you the UPPER triangular matrix. This is transposed in the LOWER triangular matrix by t(). If the data is ordered in the order x,y,z then a shock of z in t0 would only affect z itself a shock in y would affect y and z etc.

Long story short: Yes, you are right;)