Diebold-Yilmaz, IJF 2012

Use this forum for posting example programs or short bits of sample code.
Christy92
Posts: 2
Joined: Tue Dec 01, 2020 6:19 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by Christy92 »

TomDoan wrote:Are you looking at the Table 2 values (full sample) or the rolling window values. For Table 2, the simplest thing to do is probably to just reload Table 2 (Window--Report Windows selector) and export it to Excel. You can also do

write(format=xlsx,unit=copy) fromvar~tovar

which will prompt you for the file name.

For the rolling windows, you would do

copy(format=xlsx,unit=copy,dates) / fromspill tospill

Again, it will prompt you for the file name.

Hello Tom, I have done the codes of:

copy(format=xlsx,unit=copy,dates) / fromspill tospill

but it says that the FROMSPILL and TOSPILL are not identified.

Could you please tell me on how to obtain the time series data of all the spillover calculations (full sample, rolling window values, and the net pairwise spillover) to an excel file?

Thanks a bunch!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

You have to do that after the calculation of the rolling sample statistics---that's where those get computed.
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by istiak »

Hello,
In all the figures, the X-axis shows the serial number of the observation like 200, 400,..., etc. Instead, how can I put the dates like 1/25/1999, ..., 2/25/2000, etc. in the X-axis in all the graphs. I am using a smaller set of data with only 150 observations and I need to put dates in the X axis. How to change the code to do this? Thank you.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

If you have data with usable dates, it will do the graphs with dates. The DY paper has irregular dates, and when we wrote the replication, we didn't have the ability to do the graphs with irregular dates.
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by istiak »

Hello Tom,
I changed the excel file with regular dates (yearly). I attach the file here. I ran the program again with the modified excel file, still the date is not shown in the graphs. Can you please help me?
Attachments
dy_ijf2012_data.xlsx
(276.68 KiB) Downloaded 1297 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

If there's no CALENDAR instruction, there is no date scheme. Why don't you work with your own data, rather than trying to alter the DY data?
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by istiak »

Hi Tom,
Thank you so much for your comment. Now I use my own data and used the calendar option, so figures are coming with dates on the X-axis. I attach the data and code here. But, two problems. First, although the monthly data starts from 1996:1, the graphs are created from late 2012. How can I get graphs from 1996:1? Second, there are two blank parts of all the graphs between 2012-2013 and from 2013-2014. Why? Is there a way to remove them?
Thank you so much.
Attachments
ustouristdatafinal.xls
(270 KiB) Downloaded 1331 times
code long.RPF
(5.77 KiB) Downloaded 1321 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

You're doing rolling 200 observation windows with only 286 data points, so there won't be very many samples and they will start very late in the data set.

The analysis is set to:

*
* Skip any data points where the rolling VAR has an explosive root.
*

which is why you are missing observations. Your data are completely different from what DY are using---they have returns to financial assets, all of which are stationary series (so there are no issues with explosive roots). You have non-stationary series, and the CARRIVE series has a strong seasonal---in fact, its variance is dominated by the seasonal and a four lag VAR with monthly data can't possibly deal with that.
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by istiak »

Dear Tom
Thank you. Do you have a plan to write estima code for the paper, which has different time intervals?
Barunik and Krehlik (2018), Measuring the Frequency Dynamics of Financial Connectedness and Systemic Risk, Journal of Financial Econometrics, 16 (2), pp. 271--296
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by istiak »

Dear Tom,
To use the code, is it a precondition that the variables should be stationary in the VAR model?
Thank you.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

There is no theoretical reason that they have to be since the analysis is always based upon the decomposition a fixed number of steps ahead (nothing about asymptotic behavior). I assume that with the data set that wasn't clearly stationary, DY ruled out the calculation with rolling estimates which had explosive roots since they might be quite different than other estimates that had stable roots (explosive roots tend to dominate the results very quickly). However, if you're doing a modest number of steps, that shouldn't be a major issue.
izymougoue2006
Posts: 29
Joined: Tue Apr 24, 2012 8:16 pm

Unable to replicate Diebold and Yilmaz's results (2012)

Unread post by izymougoue2006 »

I am able to reproduce all of the results in Diebold and Yilmaz (2012). However, when I applied the program to my data set, I obtained most of the results except for Table 2, Figure 1, Figure 2, Figure 3, Figure 4, and Figure 5. Can you please guide me and tell me why I cannot get the desired results?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

Isn't that almost the whole paper? What does "I obtain most of the results except..." mean? If it's your own data, then you have no results with which to compare.

Note that we have a two rather long threads for this paper and for the earlier DY 2009 paper which deal with quite a few questions from users who had problems with their own data---typically because of a model too large for the amount of data or simply inadequate data for the analysis. We also have a rather lengthy description of what the program is doing.
izymougoue2006
Posts: 29
Joined: Tue Apr 24, 2012 8:16 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by izymougoue2006 »

Hello Tom
Good evening
I use the Diebold and Yilmaz (2012) methodology for an article. But I have problems with graphics using codes from Diebold and Yilmaz (2012). I can only reproduce the volatility fallout table but not the graphs with my own database trying to use codes from Diebold and Yilmaz (2012). Only the location of the graphs that are displayed but not the curves are not displayed.
can you guide me please
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz, IJF 2012

Unread post by TomDoan »

There isn't much I can do without the program and data. However, note that

1. DY 2012 is very specifically for models of volatility. The data are therefore positive. You can't apply it to as written to some other type of data.
2. The graphs are set up for four variables (mainly doing 2 x 2 matrices of graphs). If you have a different number of series, you will need to adjust the SPGRAPH instructions.
Post Reply