This is the replication from Sadorsky(2012). This fits a variety of GARCH models to a combination of returns to oil prices, "clean energy" and technology stocks and analyzes the effect of implied pair-wise hedging strategies. Note that the time-varying pairwise hedge ratio and portfolio weight calculations are common to all types of GARCH models, as they are functions only of the time-varying covariance matrices.


This is discussed in greater detail as part of the ARCH/GARCH and Volatility Models e-course.


The data set is 10 years of daily data over the 2001-2010 period, which includes the run up in oil prices and sharp declines in the stock prices in 2008. The mean model chosen is a one lag VAR on the returns:


system(model=var1)

variables dleco dloil dlpse

lags 1

det constant

end(system)


The author fits four different multivariate GARCH models to this: a standard BEKK, and three that use the VARMA model for the individual variances, one using a diagonal correlation model (assuming zero correlations between the residuals), one with CC (constant correlation) and one with DCC. Several of these models prove somewhat difficult to fit to this data set. The ones with MV=DIAG and MV=DCC both fail to converge with standard guess values. In this case (and this will be specific to this data set) we found that starting the estimation at entry 250, and feeding those estimates into a full sample estimate (using the INITIAL option on GARCH) provided convergence. (Starting at 250 avoids some large isolated outliers in two of the series). This is how that is done for the DCC model:


garch(model=var1,p=1,q=1,mv=dcc,variances=varma,method=bfgs,$

  iters=50,pmethod=simplex,piters=10,noprint) 250 *

garch(model=var1,p=1,q=1,mv=dcc,variances=varma,method=bfgs,iters=500,$

  initial=%beta,pmethod=simplex,piters=10,robusterrors,rvectors=rdcc,hmatrices=hdcc)


The first only does 50 iterations, because there is no reason to iterate to convergence when it's being used just for guess values.


All the model estimates save the (non-standardized) residuals (with the RVECTORS option, here into RDCC) and the time-variance covariance matrix estimates (with HMATRICES, here into HDCC).


The paper does a set of univariate diagnostics on each model, showing the Q on the (univariate) standardized residuals (testing for residual autocorrelation) and on their squares (testing for residual ARCH effects). With a multivariate model, you would generally prefer to do tests on jointly standardized residuals, but CC and DCC models only work with a limited amount of relationship among the series, so the univariate diagnostics will probably be adequate.


Among the four models fit, the DCC-VARMA variances model has the best log likelihood and best univariate diagnostics, so that is chosen for further analysis.


Portfolio Calculations


For the chosen DCC-VARMA variances model, the paper computes several portfolio optimization strategies using the (time-varying) conditional covariance matrices produced by the GARCH instruction. These are all done pairwise, assuming mean zero returns, so they are variance-minimizing strategies. One of these has the portfolio weights assuming a "no short" strategy, thus, they are forced to be bounded between 0 and 1 for each asset. The value at entry t for the asset pair i,j (using covariance matrix HDCC(T)) is:


%min(1.0,%max(0.0,(hdcc(t)(j,j)-hdcc(t)(i,j))/(hdcc(t)(i,i)-2.0*hdcc(t)(i,j)+hdcc(t)(j,j))))


where the optimizing weight on asset i is


\(\left( {{\sigma _{jj}} - {\sigma _{ij}}} \right)/({\sigma _{jj}} - 2{\sigma _{ij}} + {\sigma _{jj}})\)


which can be negative if the correlation between the assets is high positive and the variance of i is quite a bit higher than that of j (and can be greater than 1 if the correlation is high and the variance of i is quite a bit lower), so the calculation gets truncated to the [0,1] range.


The second portfolio calculation assumes a strategy of using one asset to hedge a unit position in the other. The short position for hedging i using j is


  set hedges(i,j) = hdcc(t)(i,j)/hdcc(t)(j,j)


Both portfolio calculations give time-varying results. The hedge ratios are presented both graphically and in table form as statistics across the sample. The graphs of the hedge ratios are done with


spgraph(vfields=%nvar,hfields=%nvar-1,fillby=rows,$

  footer="Fig 4. Time-varying hedge ratios computed from DCC model")

do i=1,%nvar

  do j=1,%nvar

     if i==j

        next

     graph(header="Hedge of "+labels(i)+" with "+labels(j))

     # hedges(i,j)

  end do j

end do i

spgraph(done)


which will do (in this case), a 3 x 2 array of graphs showing all pairs, while the table is done with


report(use=wreport,action=define,title="Table 6. Hedge ratio (long/short) summary statistics")

report(use=wreport,atrow=1,atcol=2,align=center) "Mean" "St Dev" "Min" "Max"

do i=1,%nvar

  do j=1,%nvar

     if j==i

        next

     stats(noprint,fract) hedges(i,j)

     report(use=wreport,row=new,atcol=1) labels(i)+"/"+labels(j) %mean sqrt(%variance) %minimum %maximum

  end do j

end do i

report(use=wreport,action=format,atcol=2,tocol=5,picture="*.##",align=decimal)

report(use=wreport,action=show)


A similar table is constructed with the portfolio weights, though because those have to add to one between the two elements of a pair, only one direction is shown.


Output


Statistics on Series DLECO

Observations                  2609

Sample Mean              -0.023126      Variance                   4.808126

Standard Error            2.192744      SE of Sample Mean          0.042929

t-Statistic (Mean=0)     -0.538703      Signif Level (Mean=0)      0.590138

Skewness                 -0.233807      Signif Level (Sk=0)        0.000001

Kurtosis (excess)         4.600006      Signif Level (Ku=0)        0.000000

Jarque-Bera            2324.044865      Signif Level (JB=0)        0.000000


Minimum                 -14.467302      Maximum                   14.519496

01-%ile                  -6.300807      99-%ile                    6.119683

05-%ile                  -3.431977      95-%ile                    3.161663

10-%ile                  -2.462392      90-%ile                    2.204196

25-%ile                  -1.070449      75-%ile                    1.144094

Median                    0.000000



Statistics on Series DLOIL

Observations                  2609

Sample Mean               0.047015      Variance                   6.269467

Standard Error            2.503890      SE of Sample Mean          0.049021

t-Statistic (Mean=0)      0.959090      Signif Level (Mean=0)      0.337602

Skewness                 -0.144539      Signif Level (Sk=0)        0.002593

Kurtosis (excess)         4.598233      Signif Level (Ku=0)        0.000000

Jarque-Bera            2307.585469      Signif Level (JB=0)        0.000000


Minimum                 -16.544513      Maximum                   16.409725

01-%ile                  -7.089327      99-%ile                    6.293575

05-%ile                  -3.850403      95-%ile                    3.771591

10-%ile                  -2.762245      90-%ile                    2.830286

25-%ile                  -1.282170      75-%ile                    1.443507

Median                    0.000000



Statistics on Series DLPSE

Observations                  2609

Sample Mean               0.011012      Variance                   2.652916

Standard Error            1.628778      SE of Sample Mean          0.031888

t-Statistic (Mean=0)      0.345344      Signif Level (Mean=0)      0.729863

Skewness                  0.160638      Signif Level (Sk=0)        0.000815

Kurtosis (excess)         3.821450      Signif Level (Ku=0)        0.000000

Jarque-Bera            1598.740511      Signif Level (JB=0)        0.000000


Minimum                  -8.120620      Maximum                   10.841189

01-%ile                  -4.482048      99-%ile                    4.497959

05-%ile                  -2.713011      95-%ile                    2.608114

10-%ile                  -1.883214      90-%ile                    1.685204

25-%ile                  -0.738329      75-%ile                    0.791930

Median                    0.029164



Covariance\Correlation Matrix

        DLECO       DLOIL       DLPSE

DLECO 4.806282759     0.23752     0.76512

DLOIL 1.303597467 6.267063950     0.11272

DLPSE 2.731570875 0.459537833 2.651899319



Covariance\Correlation Matrix

         DLECOSQ     DLOILSQ     DLPSESQ

DLECOSQ 152.4438821     0.27812     0.60921

DLOILSQ  55.1928376 258.3457627     0.17157

DLPSESQ  48.1065179  17.6366691  40.9039365



MV-GARCH, BEKK - Estimation by BFGS

Convergence in    66 Iterations. Final criterion was  0.0000075 <=  0.0000100


With Heteroscedasticity/Misspecification Adjusted Standard Errors

Usable Observations                      2608

Log Likelihood                    -14266.9233


   Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

Mean Model(DLECO)

1.  DLECO{1}                      0.019573414  0.016165336      1.21083  0.22596198

2.  DLOIL{1}                      0.019096179  0.011376907      1.67850  0.09324884

3.  DLPSE{1}                      0.067872021  0.019518978      3.47723  0.00050662

4.  Constant                      0.032041974  0.018403893      1.74104  0.08167599

Mean Model(DLOIL)

5.  DLECO{1}                     -0.011577350  0.017873402     -0.64774  0.51715198

6.  DLOIL{1}                     -0.021110504  0.016192621     -1.30371  0.19233201

7.  DLPSE{1}                      0.060495454  0.022146678      2.73158  0.00630312

8.  Constant                      0.085971430  0.045071723      1.90744  0.05646414

Mean Model(DLPSE)

9.  DLECO{1}                     -0.017909124  0.010088659     -1.77517  0.07586918

10. DLOIL{1}                      0.005639983  0.007638076      0.73840  0.46026919

11. DLPSE{1}                     -0.019401489  0.015054125     -1.28878  0.19747379

12. Constant                      0.062413352  0.014230776      4.38580  0.00001156


13. C(1,1)                        0.265049367  0.046804583      5.66289  0.00000001

14. C(2,1)                        0.023039362  0.071797341      0.32089  0.74829045

15. C(2,2)                        0.192431324  0.043517339      4.42195  0.00000978

16. C(3,1)                        0.081814877  0.018318400      4.46627  0.00000796

17. C(3,2)                        0.015920962  0.017930156      0.88794  0.37457125

18. C(3,3)                       -0.045230593  0.017068857     -2.64989  0.00805180

19. A(1,1)                        0.320762056  0.043253900      7.41580  0.00000000

20. A(1,2)                       -0.007085789  0.043865147     -0.16154  0.87167147

21. A(1,3)                        0.062299270  0.018392287      3.38725  0.00070597

22. A(2,1)                       -0.021366507  0.022823763     -0.93615  0.34919503

23. A(2,2)                        0.186518807  0.021765517      8.56946  0.00000000

24. A(2,3)                        0.004041510  0.011079484      0.36477  0.71527994

25. A(3,1)                       -0.131142790  0.047582869     -2.75609  0.00584964

26. A(3,2)                        0.062099397  0.048235763      1.28741  0.19795002

27. A(3,3)                        0.127785901  0.024826570      5.14714  0.00000026

28. B(1,1)                        0.934232198  0.015756523     59.29177  0.00000000

29. B(1,2)                       -0.000401384  0.014700778     -0.02730  0.97821760

30. B(1,3)                       -0.020025915  0.006109288     -3.27795  0.00104565

31. B(2,1)                        0.009030640  0.007335344      1.23111  0.21828046

32. B(2,2)                        0.978721442  0.005522196    177.23411  0.00000000

33. B(2,3)                        0.001533730  0.002911686      0.52675  0.59836729

34. B(3,1)                        0.039372435  0.012753793      3.08712  0.00202109

35. B(3,2)                       -0.015055391  0.013812903     -1.08995  0.27573462

36. B(3,3)                        0.997043089  0.005832852    170.93577  0.00000000



MV-Diagonal GARCH  with VARMA Variances - Estimation by BFGS

Convergence in    83 Iterations. Final criterion was  0.0000059 <=  0.0000100


With Heteroscedasticity/Misspecification Adjusted Standard Errors

Usable Observations                      2608

Log Likelihood                    -15552.1636


   Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

Mean Model(DLECO)

1.  DLECO{1}                      0.030481095  0.028775942      1.05926  0.28948310

2.  DLOIL{1}                      0.022755014  0.015499767      1.46809  0.14208047

3.  DLPSE{1}                      0.073888207  0.035338731      2.09086  0.03654095

4.  Constant                      0.062999845  0.033642900      1.87260  0.06112303

Mean Model(DLOIL)

5.  DLECO{1}                     -0.009020683  0.029647462     -0.30426  0.76092605

6.  DLOIL{1}                     -0.021887210  0.019119893     -1.14473  0.25231897

7.  DLPSE{1}                      0.058234330  0.037108880      1.56928  0.11658204

8.  Constant                      0.100480794  0.042033491      2.39049  0.01682574

Mean Model(DLPSE)

9.  DLECO{1}                     -0.013208908  0.019716507     -0.66994  0.50289501

10. DLOIL{1}                     -0.003394763  0.010338702     -0.32835  0.74264341

11. DLPSE{1}                     -0.019496539  0.028937419     -0.67375  0.50047129

12. Constant                      0.047274494  0.020382957      2.31931  0.02037798


13. C(1)                          0.043627286  0.020167127      2.16329  0.03051910

14. C(2)                          0.074197223  0.028661135      2.58877  0.00963181

15. C(3)                          0.012666759  0.005366026      2.36055  0.01824799

16. A(1,1)                        0.080909044  0.014246091      5.67939  0.00000001

17. A(1,2)                       -0.000774837  0.005455598     -0.14203  0.88705938

18. A(1,3)                        0.005287484  0.017848635      0.29624  0.76704659

19. A(2,1)                        0.020036528  0.011906194      1.68287  0.09240105

20. A(2,2)                        0.046762537  0.012411699      3.76762  0.00016481

21. A(2,3)                       -0.005266841  0.011511899     -0.45751  0.64730250

22. A(3,1)                        0.015558650  0.004676212      3.32719  0.00087726

23. A(3,2)                        0.000359055  0.001713039      0.20960  0.83397894

24. A(3,3)                        0.024609894  0.010999392      2.23739  0.02526107

25. B(1,1)                        0.893870053  0.017966138     49.75304  0.00000000

26. B(1,2)                        0.005828621  0.009470009      0.61548  0.53823639

27. B(1,3)                        0.007265283  0.019517978      0.37224  0.70971757

28. B(2,1)                       -0.024855421  0.016799998     -1.47949  0.13900953

29. B(2,2)                        0.937784819  0.017114673     54.79420  0.00000000

30. B(2,3)                        0.017666196  0.015281370      1.15606  0.24765621

31. B(3,1)                       -0.019636762  0.005962557     -3.29335  0.00099003

32. B(3,2)                        0.000323408  0.002746993      0.11773  0.90628039

33. B(3,3)                        0.974364982  0.013545753     71.93140  0.00000000



MV-CC GARCH  with VARMA Variances - Estimation by BFGS

Convergence in   108 Iterations. Final criterion was  0.0000077 <=  0.0000100


With Heteroscedasticity/Misspecification Adjusted Standard Errors

Usable Observations                      2608

Log Likelihood                    -14351.3657


   Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

Mean Model(DLECO)

1.  DLECO{1}                      0.008120563  0.028093415      0.28906  0.77253871

2.  DLOIL{1}                      0.022236180  0.013562402      1.63955  0.10109964

3.  DLPSE{1}                      0.090480364  0.037033431      2.44321  0.01455736

4.  Constant                      0.049047637  0.027307654      1.79611  0.07247652

Mean Model(DLOIL)

5.  DLECO{1}                     -0.017880464  0.022362459     -0.79958  0.42395705

6.  DLOIL{1}                     -0.014809566  0.022218998     -0.66653  0.50507419

7.  DLPSE{1}                      0.058604631  0.026386409      2.22102  0.02634990

8.  Constant                      0.113425743  0.044387899      2.55533  0.01060871

Mean Model(DLPSE)

9.  DLECO{1}                     -0.030288555  0.019681950     -1.53890  0.12382869

10. DLOIL{1}                      0.002492577  0.010029190      0.24853  0.80372263

11. DLPSE{1}                     -0.010741740  0.029875899     -0.35955  0.71918719

12. Constant                      0.053292898  0.020544372      2.59404  0.00948558


13. C(1)                          0.139104179  0.007197003     19.32807  0.00000000

14. C(2)                          0.100069478  0.018494057      5.41090  0.00000006

15. C(3)                          0.040684130  0.003300767     12.32566  0.00000000

16. A(1,1)                        0.086445848  0.005808065     14.88376  0.00000000

17. A(1,2)                        0.008765425  0.004174545      2.09973  0.03575243

18. A(1,3)                        0.011142408  0.021051970      0.52928  0.59661051

19. A(2,1)                        0.027480313  0.011991635      2.29162  0.02192737

20. A(2,2)                        0.052357605  0.012484207      4.19391  0.00002742

21. A(2,3)                       -0.005371610  0.011771817     -0.45631  0.64816632

22. A(3,1)                        0.020769259  0.000670237     30.98792  0.00000000

23. A(3,2)                        0.001133823  0.001189635      0.95308  0.34054723

24. A(3,3)                        0.020774603  0.006266982      3.31493  0.00091666

25. B(1,1)                        0.845396489  0.009769298     86.53606  0.00000000

26. B(1,2)                       -0.002342899  0.001591898     -1.47176  0.14108458

27. B(1,3)                        0.019770958  0.023049327      0.85777  0.39102100

28. B(2,1)                       -0.049525974  0.022173025     -2.23361  0.02550850

29. B(2,2)                        0.933207709  0.013703176     68.10156  0.00000000

30. B(2,3)                        0.031718263  0.019276139      1.64547  0.09987342

31. B(3,1)                       -0.038807523  0.000501056    -77.45154  0.00000000

32. B(3,2)                        0.000487241  0.000606292      0.80364  0.42160412

33. B(3,3)                        0.984985696  0.007030850    140.09482  0.00000000

34. R(2,1)                        0.213325919  0.016222517     13.14999  0.00000000

35. R(3,1)                        0.761037385  0.007535435    100.99448  0.00000000

36. R(3,2)                        0.078359998  0.018628722      4.20641  0.00002595



MV-DCC GARCH  with VARMA Variances - Estimation by BFGS

Convergence in   114 Iterations. Final criterion was  0.0000039 <=  0.0000100


With Heteroscedasticity/Misspecification Adjusted Standard Errors

Usable Observations                      2608

Log Likelihood                    -14234.9849


   Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

Mean Model(DLECO)

1.  DLECO{1}                      0.012758570  0.026159387      0.48772  0.62574511

2.  DLOIL{1}                      0.020603364  0.012750235      1.61592  0.10611153

3.  DLPSE{1}                      0.074930315  0.031732702      2.36130  0.01821117

4.  Constant                      0.036784075  0.029473222      1.24805  0.21201249

Mean Model(DLOIL)

5.  DLECO{1}                     -0.015225738  0.029651275     -0.51349  0.60760612

6.  DLOIL{1}                     -0.018606639  0.019460378     -0.95613  0.33900688

7.  DLPSE{1}                      0.059148634  0.033671345      1.75665  0.07897816

8.  Constant                      0.099333449  0.037088568      2.67828  0.00740021

Mean Model(DLPSE)

9.  DLECO{1}                     -0.025503494  0.017653414     -1.44468  0.14854843

10. DLOIL{1}                      0.005030439  0.009221584      0.54551  0.58540483

11. DLPSE{1}                     -0.013944973  0.026674436     -0.52278  0.60112447

12. Constant                      0.059990205  0.019821848      3.02647  0.00247428


13. C(1)                          0.059583205  0.021695872      2.74629  0.00602730

14. C(2)                          0.082571929  0.030024774      2.75013  0.00595722

15. C(3)                          0.018331797  0.005831619      3.14352  0.00166930

16. A(1,1)                        0.080523282  0.015875436      5.07219  0.00000039

17. A(1,2)                        0.004815119  0.006409883      0.75120  0.45253098

18. A(1,3)                        0.002119574  0.018127149      0.11693  0.90691699

19. A(2,1)                        0.022571933  0.009509899      2.37352  0.01761945

20. A(2,2)                        0.056075358  0.013725253      4.08556  0.00004397

21. A(2,3)                       -0.004190445  0.013550611     -0.30924  0.75713594

22. A(3,1)                        0.015560864  0.004482814      3.47123  0.00051809

23. A(3,2)                        0.001559431  0.002201553      0.70833  0.47873912

24. A(3,3)                        0.025640971  0.006826337      3.75618  0.00017252

25. B(1,1)                        0.888034378  0.023331546     38.06153  0.00000000

26. B(1,2)                        0.000527860  0.011287468      0.04677  0.96270042

27. B(1,3)                        0.015149804  0.022642399      0.66909  0.50343804

28. B(2,1)                       -0.030110264  0.014223161     -2.11699  0.03426085

29. B(2,2)                        0.927631722  0.018170822     51.05062  0.00000000

30. B(2,3)                        0.021181078  0.018152107      1.16687  0.24326446

31. B(3,1)                       -0.022309075  0.006245723     -3.57190  0.00035441

32. B(3,2)                       -0.000727499  0.003439264     -0.21153  0.83247558

33. B(3,3)                        0.975736155  0.008466516    115.24648  0.00000000

34. DCC(A)                        0.018933853  0.003466412      5.46209  0.00000005

35. DCC(B)                        0.977636695  0.004348559    224.81855  0.00000000



Univariate Diagnostics for BEKK


ECO

Q(20)r      16.57722       0.68023

Q(20)r^2      34.73182       0.02158

OIL

Q(20)r      10.04333       0.96738

Q(20)r^2      26.82265       0.14033

PSE

Q(20)r      19.13459       0.51309

Q(20)r^2      43.71686       0.00164


Univariate Diagnostics for Diag


ECO

Q(20)r      13.11870       0.87223

Q(20)r^2      19.99362       0.45833

OIL

Q(20)r      10.31916       0.96201

Q(20)r^2      18.11960       0.57953

PSE

Q(20)r      18.47843       0.55592

Q(20)r^2      30.89500       0.05659


Univariate Diagnostics for CCC


ECO

Q(20)r      14.99150       0.77689

Q(20)r^2      32.17422       0.04148

OIL

Q(20)r       9.96097       0.96887

Q(20)r^2      16.22758       0.70241

PSE

Q(20)r      19.76412       0.47277

Q(20)r^2      46.24004   7.47071e-04


Univariate Diagnostics for DCC


ECO

Q(20)r      15.82057       0.72769

Q(20)r^2      20.73236       0.41303

OIL

Q(20)r      10.08686       0.96657

Q(20)r^2      17.20482       0.63964

PSE

Q(20)r      18.45552       0.55743

Q(20)r^2      31.73149       0.04624


       Mean St Dev Min   Max

ECO/OIL 0.19   0.18 -0.20 0.74

ECO/PSE 1.10   0.30  0.58 1.93

OIL/ECO 0.23   0.22 -0.49 0.80

OIL/PSE 0.13   0.37 -0.80 1.12

PSE/ECO 0.57   0.16  0.26 1.14

PSE/OIL 0.06   0.13 -0.16 0.41



       Mean St Dev Min  Max

ECO/OIL 0.60   0.14 0.20 0.89

ECO/PSE 0.17   0.27 0.00 1.00

OIL/PSE 0.26   0.15 0.00 0.71



Graphs


Original data (end of day prices)


Squared returns




Time-varying conditional correlations



Graph of hedge ratios