Re: Diebold-Yilmaz EJ 2009
Posted: Mon Jul 28, 2014 7:40 am
Sure, though you might find it easier to pull the full table into a spreadsheet and do the calculation there.
A Forum for RATS Software and Econometrics Discussions
https://www.estima.com/forum/
If I understand correctly, the volatility spillover index can be simply the sum of bilateral index:TomDoan wrote:Sure, though you might find it easier to pull the full table into a spreadsheet and do the calculation there.
Code: Select all
Series Obs Mean Std Error Minimum Maximum
VDJIA 312 18.805720599 16.816413812 1.245033687 163.517480770
VFTSE 312 24.045548581 15.695044718 2.333598096 89.023123680
VFRA 312 16.144924712 11.929524614 1.372978378 77.649037348
VGER 312 31.651825859 22.385737142 5.019213533 224.937615018
VHKG 312 17.501344391 11.881006615 0.000000000 71.851877079
VJPN 312 16.956345612 12.369247530 0.977965432 72.345815428
VAUS 312 13.183877293 9.368036685 1.102390019 60.414698695
VIDN 312 12.050939011 8.395759190 1.657101711 77.957817683
VKOR 312 19.639843303 13.111287847 0.000000000 83.385897064
VMYS 312 15.275406073 12.174148853 1.377499545 78.498016350
VPHL 312 5.536460407 15.034851139 0.000000000 92.432280531
VSGP 312 17.485222483 12.537396488 0.000000000 66.468932933
VTAI 312 16.854627445 13.381223711 1.356296130 135.476397008
VTHA 312 22.539940588 21.990409814 1.472241780 180.220154357
VARG 312 13.913621730 9.905503949 1.622676937 79.273626989
VBRA 312 5.134383231 17.079478336 0.000000000 183.598019942
VCHL 312 17.317173300 13.716375436 0.000000000 82.163506397
VMEX 312 22.027073677 15.284161896 2.152959869 110.224982646
VTUR 312 19.152543265 11.801389040 2.406105672 73.075583443
WGER 312 19.922955651 14.365529052 0.868032532 114.548977447
WVRE 312 21.025752897 19.003006683 0.000000000 166.522949656
WVHU 312 0.000000000 0.000000000 0.000000000 0.000000000
WIRE 312 8.675417429 16.570860729 0.000000000 85.511985218
VWTA 312 23.742337016 17.667546253 1.978095895 125.857717148
WLUX 312 22.035149391 35.408063527 0.000000000 310.572875875
WNET 312 18.830784554 12.067356603 2.445203593 80.730055918
WNOR 312 27.421267692 24.126051104 1.125789062 213.211865714
WPOL 312 26.097834280 17.259470914 4.207864054 136.338282670
WPOR 312 0.000000000 0.000000000 0.000000000 0.000000000
WRUS 312 6.647674386 13.823942910 0.000000000 78.993488728
WSPA 312 25.869561488 23.837147792 1.716495991 189.436935580
WWE 312 21.046965398 14.240431666 1.018975765 91.291724002
WSWI 312 10.697961125 7.278957686 0.735990763 57.015128023
WUNIK 312 19.869060062 14.376287151 1.453609302 91.535748841
WARG 312 11.218805437 16.751928988 0.000000000 101.066084210
WBRA 312 17.354084858 16.742478046 0.000000000 130.079984576
WCHI 312 19.385110159 12.710107254 1.861770072 89.913239149
WCLO 312 0.000000000 0.000000000 0.000000000 0.000000000
WME 312 4.203042882 13.070291418 0.000000000 174.398834673
WPRU 312 0.000000000 0.000000000 0.000000000 0.000000000
WEGY 312 19.214919236 18.353594886 0.000000000 159.967731582
WISA 312 17.246828435 13.432962851 1.281413465 135.793415472
WMOR 312 0.432486015 2.150149497 0.000000000 16.353517590
WSOU 312 14.985795219 10.367191236 2.799430607 92.929789513
WTUR 312 24.001604228 17.452260332 2.868645573 131.222714094
WCAN 312 13.629008598 11.791558418 1.032773753 95.149534309
WSU 312 20.424126387 18.344531427 1.766047317 110.577481434
Dear Tom,TomDoan wrote:You have 34 series, 2 lag VAR on 53 data points. That won't work. You really shouldn't have the NOPRINT option on the ESTIMATE until you have this working. I understand that you're trying to extend this to some new countries, but if there isn't the right data, you won't be able to make it work.
Code: Select all
open data VolatilityR.xls
data(format=xls,org=columns) /MMM MO MON MRK MS MSFT NKE NOV NSC ORCL OXY PEP AAPL ABT ACN AIG ALL AMGN AMZN APA APC AXP BA BAC BAX BIIB BK BMY C CAT CL CMCSA COF COP COST CSCO CVS CVX DD DIS DOW DVN EBAY EMC EMR EXC F FCX FDX FOXA GD GE GILD GS HAL
dec vect[int] vols
enter(varying) vols
#MMM MO MON MRK MS MSFT NKE NOV NSC ORCL OXY PEP AAPL ABT ACN AIG ALL AMGN AMZN APA APC AXP BA BAC BAX BIIB BK BMY C CAT CL CMCSA COF COP COST CSCO CVS CVX DD DIS DOW DVN EBAY EMC EMR EXC F FCX FDX FOXA GD GE GILD GS HAL HD
system(model=volvar)
variables MMM MO MON MRK MS MSFT NKE NOV NSC ORCL OXY PEP AAPL ABT ACN AIG ALL AMGN AMZN APA APC AXP BA BAC BAX BIIB BK BMY C CAT CL CMCSA COF COP COST CSCO CVS CVX DD DIS DOW DVN EBAY EMC EMR EXC F FCX FDX FOXA GD GE GILD GS HAL HD
compute usegirf=1
lags 1 2
det constant
end(system)
estimate(noprint)
*
* Save the full estimation range for later use
*
compute rstart=%regstart(),rend=%regend()
*
* Analyze the 10 step responses
*
compute nsteps=10
*********************************************************************
*
* Produce the appropriate "factor" matrix from %sigma
*
function FactorMatrix
type rect FactorMatrix
if usegirf
compute FactorMatrix=%sigma*inv(%diag(%sqrt(%xdiag(%sigma))))
else
compute FactorMatrix=%decomp(%sigma)
end
compute gfactor=FactorMatrix()
errors(model=volvar,steps=nsteps,factor=gfactor,stderrs=gstderrs,noprint,results=gfevd)
compute gfevdx=%xt(gfevd,nsteps)
*
* These are for computing the contributions from others, to others and
* to others including own for each variable.
*
dec vect tovar(%nvar) fromvar(%nvar) tototal(%nvar)
ewise fromvar(i)=%sum(%xrow(gfevdx,i))-gfevdx(i,i)
ewise tovar(i)=%sum(%xcol(gfevdx,i))-gfevdx(i,i)
ewise tototal(i)=tovar(i)+1-fromvar(i)
compute spillover=100.0*%sum(tovar)/%nvar
*
report(action=define,title="Table for Global Market Volatility")
report(atrow=2,atcol=2) 100.0*gfevdx
report(atrow=%nvar+2,atcol=1,fillby=rows) "Contribution to others" 100.0*tovar
report(atrow=%nvar+3,atcol=1,fillby=rows) "Contribution including own" 100.0*tototal
report(atcol=%nvar+2,atrow=1) "From Others"
report(atcol=%nvar+2,atrow=2,fillby=cols) 100.0*fromvar
report(atrow=%nvar+2,atcol=%nvar+2,fillby=cols) 100.0*%sum(tovar)
report(atrow=%nvar+3,atcol=%nvar+2,align=right) %strval(spillover,"##.#")+"%"
report(atrow=2,atcol=2,torow=%nvar+1,tocol=%nvar+1,action=format,picture="*.#")
report(atrow=%nvar+2,torow=%nvar+3,atcol=1,tocol=%nvar+2,action=format,picture="###")
report(atcol=%nvar+2,atrow=2,torow=%nvar+2,action=format,picture="###")
report(action=show)
The limit depends upon how much data you have. You would need a lot of observations to do that. With a one lag VAR, you would need about 1000 just to get a full rank matrix, but the results from anything less than probably 2500 would be so poorly defined that there would be no point.omid_ie wrote:Dear Tom;
1. How can I extend the number of variables? here I have 52 stocks, How can I extend it to 500 stocks? what is the limit?
REPORT(ACTION=SHOW,...) has options to export the table:omid_ie wrote: 2. How can I export "Table for Global Market Volatility" into excel format?