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!
Replicate IRF in Diebold Rudebusch Aruoba (2006)
Re: Replicate IRF in Diebold Rudebusch Aruoba (2006)
- Attachments
-
- DRA_Model.zip
- (24.82 KiB) Downloaded 737 times
Re: Replicate IRF in Diebold Rudebusch Aruoba (2006)
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.
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)
Dear Tom,
thanks for the help!
Best
Siwen
thanks for the help!
Best
Siwen