Page 1 of 1

BVAR IRFs

Posted: Sat Jan 08, 2011 12:00 pm
by donihue
Hello Esther,

Best wishes for the new year! And thanks again for this excellent add-in.

In an earlier post, I asked you how the IRFs were calculated, because I found a discrepancy between that IRFs calculated using the add-in with a flat-flat prior and those from a standard VAR, despite coefficients being the same (as they should be).

In the bvar.prg file, you have put "matrix {%shock} = @cholesky({%A0})" and "call impulse({%responses}, {%Bv}, {%shock}, {%IRFPers}, !m, {%p})", so we should get the same results, if I understand the code. However, it seems that this is still not the case.

I attach two example files, one (BVAR08) being the results from the latest version of the add-in, and the other (BVAR08a) from the standard VAR, which show the persisting differences. You will see that although the responses of a variable to itself are identical, there are differences in the responses of variables to others.

Perhaps I have misunderstood how the calculations are performed, or is something strange going on here?

Best regards
Donihue

Re: BVAR IRFs

Posted: Mon Jan 10, 2011 10:31 am
by EViews Esther
In the bvar.prg file, you have put "matrix {%shock} = @cholesky({%A0})" and "call impulse({%responses}, {%Bv}, {%shock}, {%IRFPers}, !m, {%p})", so we should get the same results, if I understand the code.
If you look at the subroutine file, impulse.prg, you will see the following command line which is commented out
'matrix tsmat = @transpose(smat)
(Why commented out? the Cholesky factorization finds the lower Cholesky factor.)
Due to this line, you will not get the same results by calling the function impulse(....).

I fix the problem by changing the code as:

call impulse({%responses}, {%Bv}, {%shock}, {%IRFPers}, !m, {%p})
for !ii=1 to !m
for !i=1 to {%irfpers}
matrix(!m,{%irfpers}) {%res}_{!ii}
matrix {%response} = @subextract({%responses}, !m*(!i-1)+!ii, !m*(!i-1)+1, !m*(!i-1)+!ii, !i*!m)
matplace({%res}_{!ii}, @transpose({%response}),1, !i)
next
next

Best,
Esther

Re: BVAR IRFs

Posted: Tue Jan 11, 2011 5:03 am
by donihue
Hi again, Esther.

Thanks for your reply and re-write suggestion.

I apologise for pestering, but I tried it out, and unless I have made a mistake (I changed only the one line in bvar.prg which you highlighted in red), it doesn't seem to solve the problem, as the attached file indicates: only the first column appears in the IRFs, for some reason.

Regards
Donihue

Re: BVAR IRFs

Posted: Tue Jan 11, 2011 9:43 am
by EViews Esther
Dear Donihue,

Can you re-download BVAR.aipz and re-do your estimation?
If you still see the problem, please let me know.

Best,
Esther

Re: BVAR IRFs

Posted: Tue Jan 11, 2011 11:17 am
by donihue
Hello again, Esther,

I have re-downloaded the BVAR add-in and installed it.

When I attempt to construct the BVAR model cited in earlier posts, I receive the message "_YLAG01 is not defined", and the programme crashes, spewing out extraneous variables into the workfile. (I recall we had a similar problem once some months earlier ...). Could the re-write have gummed something up?

Regards
Donihue

Re: BVAR IRFs

Posted: Tue Jan 11, 2011 4:18 pm
by EViews Esther
I am updating on impulse response calculation by using simulation.

I will upload the new one soon with the solution of your problem.