Diebold-Yilmaz EJ 2009

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz EJ 2009

Unread post by TomDoan »

What does "These variables could be analyzed in a simple panel framework that inflation for example, refers to all emerging countries " mean? If you're talking about some type of more standard macro VAR including several different macro series in a single model, then you shouldn't be looking at DY as the guide.

If you are talking about one model for inflation, and a different one for industrial production, etc. then the DY calculations would allow you to aggregate either sources or targets. You can calculate the total spillover from the G7 to (say) Greece in a 20 country VAR.
smgrilli
Posts: 7
Joined: Fri Aug 03, 2018 8:54 am

Re: Diebold-Yilmaz EJ 2009

Unread post by smgrilli »

I got a similar issue while using DY. Error message:

## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
The Error Occurred At Location 23, Line 4 of FACTORMATRIX
Called From Location 172, Line 11 of loop/block

The spillover index can be computed, but I encounter this error in the rolling estimation. I'm iterating the same code for different measures, but the number of missing values changes substantially between variables. In particular, one variable has almost half of the observations missing. The code is as follows:

Code: Select all

* Rolling window analysis
*
compute nspan=200
set spillreturns rstart+nspan-1 rend = 0.0
do end=rstart+nspan-1,rend
   estimate(noprint) end-nspan+1 end
   *
   * Skip any data points where the rolling VAR has an explosive root.
   *
   eigen(cvalues=cv) %modelcompanion(returnvar)
   if %cabs(cv(1))>=1.0 {
      compute spillreturns(end)=%na
      next
   }
   compute gfactor=FactorMatrix()
   errors(model=returnvar,steps=nsteps,factor=gfactor,stderrs=gstderrs,noprint,results=gfevd)
   compute gfevdx=%xt(gfevd,nsteps)
   ewise tovar(i)=%sum(%xcol(gfevdx,i))-gfevdx(i,i)
   compute spillreturns(end)=100.0*%sum(tovar)/%nvar
end do end
graph(footer="Spillover plot. Returns. 200-weeks window. 10 step horizon")
# spillreturns


Based on previous threads, I have reduced the window to 20 observations just to try, but I get the same error.
Any suggestions about how to overcome this issue?

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

Re: Diebold-Yilmaz EJ 2009

Unread post by TomDoan »

Going to a very short window is exactly the wrong thing to do. You run into that problem when there isn't enough data in a span to estimate the model. How many variables do you have and how many lags?
smgrilli
Posts: 7
Joined: Fri Aug 03, 2018 8:54 am

Re: Diebold-Yilmaz EJ 2009

Unread post by smgrilli »

I have 10 variables and 1353 observations, with many missing values. The VAR is defined as

Code: Select all

system(model=returnvar)
variables returns
lags 1 2
det constant
end(system)
I attached a sample .xls file

Thanks
Attachments
spillovers copy.xls
(296.5 KiB) Downloaded 919 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz EJ 2009

Unread post by TomDoan »

You can't do moving windows analysis when entire windows are missing data. Figure out what range actually works for that part and restrict yourself to the appropriate subsample.
smgrilli
Posts: 7
Joined: Fri Aug 03, 2018 8:54 am

Re: Diebold-Yilmaz EJ 2009

Unread post by smgrilli »

That's clear, thanks Tom. I thought the command does compute the rolling window only for the available data automatically. I trim the file and run it again.

Thanks
curiousresearcher
Posts: 41
Joined: Sun May 19, 2019 9:56 pm

Re: Diebold-Yilmaz EJ 2009

Unread post by curiousresearcher »

Can anyone tell how has the volatility series been generated as return series can be quickly computed from price data?

Also, can we get these volatility information series from Thomson Eikon database or we need to compute it?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz EJ 2009

Unread post by TomDoan »

vicky007 wrote:Can anyone tell how has the volatility series been generated as return series can be quickly computed from price data?

Also, can we get these volatility information series from Thomson Eikon database or we need to compute it?
That's described in the 2009 paper---it's computed from the high/low/open/close for the week. However, if you have estimates (remember that volatility isn't observable, so has to be estimated somehow) from a well-known database, there's no reason you can't use that.
curiousresearcher
Posts: 41
Joined: Sun May 19, 2019 9:56 pm

Re: Diebold-Yilmaz EJ 2009

Unread post by curiousresearcher »

TomDoan wrote:
vicky007 wrote:Can anyone tell how has the volatility series been generated as return series can be quickly computed from price data?

Also, can we get these volatility information series from Thomson Eikon database or we need to compute it?
That's described in the 2009 paper---it's computed from the high/low/open/close for the week. However, if you have estimates (remember that volatility isn't observable, so has to be estimated somehow) from a well-known database, there's no reason you can't use that.
Dear Tom,

Thanks a lot i am using thomson eikon databse and it is allowing me the option of volatility (1 month), volatility (2 month), volatility (3 month), volatility (6 month), volatility (1 year) and volatility (2 days).

So should i be using volatility (2 days) for daily dates as most appropriate measure for DY method . I am attacing the data file taken from Thomson EIKON
Attachments
volatility estima.csv
(104.34 KiB) Downloaded 800 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Diebold-Yilmaz EJ 2009

Unread post by TomDoan »

They have two day, one month and not one week? That seems very odd. Two day volatility estimates with daily data will have an overlap problem.

Can't you get the high/low/open/close information to generate your own volatility estimates?


Last bumped by TomDoan on Thu Aug 31, 2023 8:12 pm.
Post Reply