Page 2 of 2

Re: Replicate IRF in Diebold Rudebusch Aruoba (2006)

Posted: Thu Nov 08, 2018 3:09 am
by swnzh86
Here is the plot code.

spgraph(vfields=6,hfields=6)
do j = 1,6
do i = 1,6
graph(min=-1.25,max=1.25,NODATES,VTICKS=4, NUMBER=0) 3
# IRFGRAPH(i,j)
# upper_matrix(i,j)
# lower_matrix(i,j)
end do i
end do j
spgraph(done)


However, the problem is not the plot, since the calculation of the upper_matrix and lower_matrix that store that confidence bands is corrupted.
Only upper_matrix(6,6) and lower_matrix(6,6) are estimated correctly while others only contain zero.
Here is the replication code plus dlmirf and modified varirfdelta in a zip file.

Thanks!

Re: Replicate IRF in Diebold Rudebusch Aruoba (2006)

Posted: Thu Nov 08, 2018 9:48 am
by TomDoan
You need to add local i j to the VARIRFDELTA procedure. (That was missing in the original procedure, and causes problems when embedded within your own i,j loop).

Note, however, that I don't think that what they did (and what you are doing) is actually correct. The estimated factors aren't "data"; they're estimates, and they're estimates that depend upon the value of lambda. It looks like they are taking lambda at the maximum likelihood value, taking the maximum likelihood estimates of the factors based upon that, and then doing fairly standard VAR analysis acting like those are known. That does not give you the uncertainty from the model as a whole.

Re: Replicate IRF in Diebold Rudebusch Aruoba (2006)

Posted: Thu Nov 08, 2018 11:07 am
by swnzh86
Dear Tom,

thanks for the help!

Best

Siwen