Page 1 of 4
Diebold-Yilmaz EJ 2009
Posted: Mon Mar 28, 2011 4:19 pm
by TomDoan
dieboldyilmaz_ej2009.zip is a set of replication files for Diebold and Yilmaz(2009), "Measuring Financial Asset Return and Volatility Spillovers, with Application to Global Equity Markets," Economic Journal, vol. 119, no. 534, 158-171. This does both the full sample and rolling VAR analyses.
Detailed description
Re: Diebold-Yilmaz EJ 2009
Posted: Thu May 26, 2011 8:40 pm
by dec3fc
Hi Tom,
Thank you very much for making this replication files available. I have managed to compute and graph both standard (Diebold and Yilmaz, 2009) and generalised (Diebold and Yilmaz, 2011) spillover indices. However, I am having a difficulty in getting the values and figures for both gross and net directional To/From indices appearring in Diebold and Yilmaz (2011). I would be most grateful if you could please advise on what need to be added or changed in this replication file in order to compute the directional measures and figures.
Many thanks
Best,
Frankie
Re: Diebold-Yilmaz EJ 2009
Posted: Fri May 27, 2011 10:27 am
by TomDoan
I'm a bit confused about the question. The same measures are being used in both the 2009 and 2011 papers, and are included in the borders of the table. The one major difference with the 2011 paper is that the values are invariant to order.
Re: Diebold-Yilmaz EJ 2009
Posted: Fri May 27, 2011 5:58 pm
by dec3fc
Hi Tom,
Many thanks for the prompt response. In 2011 paper, in addition to putting forward a measure which is invariant to the order of variables, the authors have also decomposed the total contribution into a few directional measures to capture the contribution 'to and from' a particular market i (as in figures 3 -6). My initial question was how could we compute these directional measures and figures using the replicated files you have kindly provided us.
Many thanks
Frankie
Re: Diebold-Yilmaz EJ 2009
Posted: Sat Jun 04, 2011 7:01 pm
by TomDoan
dec3fc wrote:Hi Tom,
Many thanks for the prompt response. In 2011 paper, in addition to putting forward a measure which is invariant to the order of variables, the authors have also decomposed the total contribution into a few directional measures to capture the contribution 'to and from' a particular market i (as in figures 3 -6). My initial question was how could we compute these directional measures and figures using the replicated files you have kindly provided us.
Many thanks
Frankie
No. That's still the same information. In the N x N table, the "To"'s are in the columns and the "From"s are in the rows.
Re: Diebold-Yilmaz EJ 2009
Posted: Tue Jul 17, 2012 12:42 pm
by timkrause
Hi,
I just started looking at this since I am also interested in using the 2011 program. I believe Frankie is referring to Figure 6 in DY2011 where they create and chart the time series of net pairwise volatility spillovers. I will try to modify the code to extract these variables. Any other suggestions would be appreciated.
Thanks,
Tim
Re: Diebold-Yilmaz EJ 2009
Posted: Wed Jul 18, 2012 3:15 pm
by TomDoan
The directional values are obtained using
ewise fromvar(i)=%sum(%xrow(gfevdx,i))-gfevdx(i,i)
ewise tovar(i)=%sum(%xcol(gfevdx,i))-gfevdx(i,i)
where gfevdx is the extracted value for a particular horizon. 100.0*fromvar(i) is the contribution from other variables to variable i(in percentages). 100.0*tovar(i) is the total contribution to all other variables from variables to i. The bilateral i to j is 100.0*gfevdx(j,i)/%sum(%xrow(gfevdx,j)). Whichever calculations you need for the rolling calculations have to be saved into a slot in a series so they can be graphed later.
Re: Diebold-Yilmaz EJ 2009
Posted: Wed Jul 18, 2012 8:36 pm
by timkrause
Thanks Tom,
Yes, I figured out that the needed values were in "gfevdx", so I'm trying to add code to pull them out of that matrix and into series' during each iteration.
Tim
Re: Diebold-Yilmaz EJ 2009
Posted: Thu Jul 19, 2012 8:50 pm
by timkrause
Got it. I have a 10 x 10 matrix and I was interested in the spill from column one to row two. So I inserted this statement in the rolling window analysis, just below compute spillvols(end)...
compute tovol2(end)=100.0*gfevdx(2,1)
I also needed to initialize the series with "set tovol1 rstart+nspan-1 rend = 0.0" just below "set spillvols rstart..."
Hope that helps,
Tim
Re: Diebold-Yilmaz EJ 2009
Posted: Wed Aug 01, 2012 10:07 am
by tomcy
Hi Tim and Tom,
Thanks for the information above, it is really useful. Similar to other posts above, I am trying to replicate the directional spillover charts plotted in Figure 3 to Figure 6 of the Diebold and Yilmaz (2011) paper. To start, I am looking at the directional spillovers to others and from others (figs 3 and 4). I understand how the values I need come from gfevdx but I have been struggling a bit with saving and graphing the series from the rolling regression. I think I have almost figured out the code and wanted to check here that I am doing this correctly. To obtain the spillovers from variable (1) to all other variables (from stocks to others as in top left panel of Figure 3 in DY 2011 paper), I have added the following two lines to the original code (as well as set vol1 rstart+….to initialise the series):
ewise fromvar(i)=%sum(%xrow(gfevdx,i))-gfevdx(i,i)
compute vol1(end)=100.0*fromvar(1)
My code looks like this (my additions to original code in red):
ewise tovar(i)=%sum(%xcol(gfevdx,i))-gfevdx(i,i)
ewise fromvar(i)=%sum(%xrow(gfevdx,i))-gfevdx(i,i)
compute spillreturns(end)=100.0*%sum(tovar)/%nvar
compute vol1(end)=100.0*fromvar(1)
end do end
graph(footer="Spillover plot. Returns. 200 week window. 10 step horizon")
# vol1
Similarly to obtain the directional spillovers to variable (1) from others (Fig 4) I use:
ewise tovar(i)=%sum(%xcol(gfevdx,i))-gfevdx(i,i)
compute vol2(end)=100.0*tovar(1)
To obtain the spillovers to variables (2),(3),(4), I use compute vol2(end)=100.0*tovar(2) etc and so on for variables (3) and (4). Is this the appropriate way to calculate the directional spillovers to and from the four variables? Any advice would be greatly appreciated.
Thank you,
Tom
Re: Diebold-Yilmaz EJ 2009
Posted: Sat Oct 12, 2013 4:40 am
by blucey
Im also wondering about the individual directional spillovers a la 2011 paper. Anybody get any further with this?
Re: Diebold-Yilmaz EJ 2009
Posted: Sun Oct 13, 2013 6:46 pm
by TomDoan
Re: Diebold-Yilmaz EJ 2009
Posted: Tue Jan 21, 2014 6:01 am
by nikosant82
Dear Tom,
Does it make sense to use Structural decomposition, instead of Cholesky (or GIRF), and do the spillover index analysis as in Diebold and Yilmaz (2009)?
I have amended the code by estimating an SVAR model and everything seems to work fine up to the generation of the Spillover table.
However, when I try to generate the spillover plot using rolling windows I get the following mistake:
Code: Select all
## SR5. Writing Range -32707 to 198 of Series SPILLRETURNS. (Incorrect start,end or SMPL)
Something is wrong with the data range and which I cannot understand.
I would be very grateful if you could help me finding the solution to this and whether the structural decomposition and code I've prepared make sense?
Many thanks,
Nikos
Re: Diebold-Yilmaz EJ 2009
Posted: Tue Jan 21, 2014 9:10 am
by TomDoan
nikosant82 wrote:Dear Tom,
Does it make sense to use Structural decomposition, instead of Cholesky (or GIRF), and do the spillover index analysis as in Diebold and Yilmaz (2009)?
You could, thought it's not particularly interesting, since you're just reading information out of a standard FEVD.
nikosant82 wrote:
I have amended the code by estimating an SVAR model and everything seems to work fine up to the generation of the Spillover table.
However, when I try to generate the spillover plot using rolling windows I get the following mistake:
Code: Select all
## SR5. Writing Range -32707 to 198 of Series SPILLRETURNS. (Incorrect start,end or SMPL)
Something is wrong with the data range and which I cannot understand.
You have to move
compute rstart=%regstart(),rend=%regend()
up after the
ESTIMATE instruction. Because you have an extra estimation instruction that wasn't in the original program (
CVMODEL) the %REGSTART() and %REGEND() get redefined from what they were immediately after the ESTIMATE.
Re: Diebold-Yilmaz EJ 2009
Posted: Mon Jul 28, 2014 6:53 am
by zy761
TomDoan wrote:The directional values are obtained using
ewise fromvar(i)=%sum(%xrow(gfevdx,i))-gfevdx(i,i)
ewise tovar(i)=%sum(%xcol(gfevdx,i))-gfevdx(i,i)
where gfevdx is the extracted value for a particular horizon. 100.0*fromvar(i) is the contribution from other variables to variable i(in percentages). 100.0*tovar(i) is the total contribution to all other variables from variables to i. The bilateral i to j is 100.0*gfevdx(j,i)/%sum(%xrow(gfevdx,j)). Whichever calculations you need for the rolling calculations have to be saved into a slot in a series so they can be graphed later.
Dear Tom,
In addition to the bilateral volatility spillover index from variable i to variable j, is it able to to calculate the index from a group of variable (e.g. a,b,c) to another group of variable (e.g. x,y,z) (The number of variables in the group is less than the total variables in the system)?
Best regards,
Jasmine