Beginner problems in DCC-GARCH

Discussions of ARCH, GARCH, and related models
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Beginner problems in DCC-GARCH

Unread post by juustone »

Dear Tom,

Please accept my sincere apologies for upcoming questions, since I´m quite new to DCC-GARCH model and I just started using Rats.

I am trying to find if two stock market indices are integrated with each other, and apparently one step DCC procedure (general) can be used for this.

When using the wizard, dependent variables are log returns of these two separated stock markets. But should I add something on "mean model variables" besides "constant" ? And should I add also something in "variance shift variables" ?

I got this task from my professor, but he´s now off-duty, so I have been learning by doing, reading this page, manual and etc. He said that the outcome should be something like in attachment.

Thanks for any comment!

Larry
Attachments
dcc-garch.png
dcc-garch.png (107.69 KiB) Viewed 481888 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

Just to understand, was the attachment done with a different data set?

What you're looking at would have been done with mean model variables russia{1} eurozone{1} in addition to CONSTANT. It's model type DCC, with the "Asymmetric Effects" checkbox clicked on. There are no variance shifts.

Just a suggestion that you make sure to scale up the returns by 100, as is done in the GARCHMV.RPF example:

set xjpn = 100.0*log(usxjpn/usxjpn{1})
set xfra = 100.0*log(usxfra/usxfra{1})
set xsui = 100.0*log(usxsui/usxsui{1})

That gives better scale to the C coefficients (without the scaling, they're so small the standard errors don't even show as non-zero).
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Re: Beginner problems in DCC-GARCH

Unread post by juustone »

Thank you Tom for a prompt answer!

The attachment in my previous comment was done with a different data set (my observable country pairs are Russia & Ukraine, Russia & Kazakhstan, Russia & Georgia and Russia & Kyrgyzstan). So the attachment supposed to show how the outcome should look like as an example.

But speaking about the results, as I add more mean model variables in addition to CONSTANT, I get the following result with every country pair:

MV-GARCH, DCC - Estimation by BFGS
NO CONVERGENCE IN 8 ITERATIONS
LAST CRITERION WAS 0.0000000
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Daily(5) Data From 2007:03:15 To 2015:04:28
Usable Observations 2119
Log Likelihood NA

All returns are scaled by 100, as it´s done in example you mentioned. Also when using just basic code for DCC (GARCH(P=1,Q=1,MV=DCC) / COUNTRY1 COUNTRY2, the results are the same (no convergence), besides one country pair. What I´m doing wrong and what can be done to get converged results ?

Thanks again for your patience for answering my questions!

Here´s output and input files, if they help to understand. With CC- and BEKK-Garch everything works fine.
DCC2015(o).RPF
(1.83 KiB) Downloaded 2928 times
DCC2015(i).RPF
(489 Bytes) Downloaded 2824 times
[attachment=1]
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

Are you sure you're running that on returns? The mean model results are showing near unit root behavior, which you shouldn't have with returns.
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Re: Beginner problems in DCC-GARCH

Unread post by juustone »

I´m running it on returns and unit root test have been done. I use MSCI price indices which are transformed to returns.

As I tried few times more, I got results from GARCH(P=1,Q=1,MV=DCC) / COUNTRY1 COUNTRY2 for most of the country pairs, but I need also mean spillover, which I do not get from above mentioned code, I suppose, or am I wrong?
Attachments
russia_kazakhstan.RPF
(1.42 KiB) Downloaded 2726 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

Your problem here is that you're running the returns on the current values (that is, on themselves) rather than their lags.

GARCH(P=1,Q=1,MV=DCC,REGRESSORS) / LRUS LUKR
# Constant LRUS LUKR

The regressors should be constant lrus{1} lukr{1}

The output that you're showing has spillovers in the variance equations. If you're looking for spillovers in the means, then you have to fix the regressor list as described above.
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Re: Beginner problems in DCC-GARCH

Unread post by juustone »

Thank you Tom for a great support and help!

I got the results for three country pairs. For Kyrgyzstan, I think there´s not much to do, since their price index is what it is:
Attachments
Kyrgyzstan_returns.JPG
Kyrgyzstan_returns.JPG (50.89 KiB) Viewed 481838 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

It looks like about half the days are true zeros. Is that correct?
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Re: Beginner problems in DCC-GARCH

Unread post by juustone »

Yes, that´s correct. Seems that there´s nothing happening for many days. Also tried for shorter period, but still does not work.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

There is *some* literature on volatility for thinly traded markets. However, it will be quite a bit more demanding than fitting well-known GARCH models. Have you thought about switching to weekly returns?
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Re: Beginner problems in DCC-GARCH

Unread post by juustone »

Thank you Tom for your help! Also the last data set worked well after your suggestion.


But I have still few questions. They are from slightly different area ( I did not wan´t to make new topic).

When calculating Covariance∖Correlation matrix, for example between Russia (lrus) and Ukraine (lukr), I got the following:

Covariance∖Correlation Matrix
LRUS LUKR
LRUS 5.379964 0.34715
LUKR 1.798606 4.98946

Should it be close to one between LRUS & LRUS etc. ?

The second question is about L-B Q values; how I can calculate them?

Here´s again example of the desired outcome:
Attachments
Näyttökuva 2015-07-31 kello 17.12.23.png
Näyttökuva 2015-07-31 kello 17.12.23.png (66.08 KiB) Viewed 481822 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

juustone wrote:Thank you Tom for your help! Also the last data set worked well after your suggestion.


But I have still few questions. They are from slightly different area ( I did not wan´t to make new topic).

When calculating Covariance∖Correlation matrix, for example between Russia (lrus) and Ukraine (lukr), I got the following:

Covariance∖Correlation Matrix
LRUS LUKR
LRUS 5.379964 0.34715
LUKR 1.798606 4.98946

Should it be close to one between LRUS & LRUS etc. ?
It is what it is. That's not really something that anyone not researching those particular markets could tell you.
juustone wrote: The second question is about L-B Q values; how I can calculate them?

Here´s again example of the desired outcome:
Unfortunately, it's hard to tell what's being done from just the output. I'm guessing that output is generated using the univariate standardized residuals. From the GARCHMV.RPF example, the calculates (three sets) of residuals for a different model. It's the RSERIES and MVHSERIES options that are needed.

Code: Select all

*
* Diagnostics on (univariate) standardized residuals
*
garch(model=var1,mv=bekk,asymmetric,p=1,q=1,distrib=t,$
   pmethod=simplex,piters=10,iters=500,$
   rseries=rs,mvhseries=hhs,stdresids=zu,derives=dd)
set z1 = rs(1)/sqrt(hhs(1,1))
set z2 = rs(2)/sqrt(hhs(2,2))
set z3 = rs(3)/sqrt(hhs(3,3))
The first output that you have is from an instruction like

VCV
# z1 z2

The others are probably done with @REGCORRS procedures applied to z1 and its square, z2 and its square. However, the @BDINDTESTS procedures in GARCHMV.RPF do those two tests and more, and label them better.
juustone
Posts: 17
Joined: Mon Jul 20, 2015 11:40 am

Re: Beginner problems in DCC-GARCH

Unread post by juustone »

Thanks for your answer!

Somehow I can´t make the Q-test. The thing is that I´m trying to make it to pairwise series. For single serie, it worked.

Is it possible to use wizard on this ?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beginner problems in DCC-GARCH

Unread post by TomDoan »

You want to use @MVQSTAT for a joint test, but that needs to be applied to a jointly standardized set of residuals. The diagnostics for multivariate GARCH models are described in Section 9.4.6 of the User's Guide. This is one of the multivariate diagnostics.
ChongoA
Posts: 3
Joined: Tue Aug 04, 2015 7:13 am

Re: Beginner problems in DCC-GARCH

Unread post by ChongoA »

Good Day Tom,
I am indeed a beginner in DCC-GARCH and need encougement. I modelled a Univariate AR(1) mean models for each series, DCC model for the variance with the following codes and results.

Code: Select all

equation(constant) spq dstpr 1
equation(constant) bozq dboz 1
equation(constant) tbq tb1 1
group ar1 spq tbq bozq
garch(p=1,q=1,model=ar1,mv=dcc,pmethod=simplex,piter=10,iter=200)

Code: Select all

MV-GARCH, DCC - Estimation by BFGS
Convergence in    80 Iterations. Final criterion was  0.0000000 <=  0.0000100
Monthly Data From 2001:05 To 2014:12
Usable Observations                       164
Log Likelihood                       -80.9807

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                      0.010569822  0.002321832      4.55236  0.00000530
2.  DSTPR{1}                      0.155954869  0.090163092      1.72970  0.08368435
3.  Constant                      0.439474660  0.058276811      7.54116  0.00000000
4.  TB1{1}                        0.002277418  0.019985327      0.11395  0.90927387
5.  Constant                      0.440757291  0.057072721      7.72273  0.00000000
6.  DBOZ{1}                       0.001996035  0.018854322      0.10587  0.91568855
7.  C(1)                         -0.000022434  0.000015127     -1.48307  0.13805620
8.  C(2)                          2.529424553  0.347706134      7.27460  0.00000000
9.  C(3)                          2.561119132  0.345578953      7.41110  0.00000000
10. A(1)                          0.411814867  0.143348995      2.87281  0.00406835
11. A(2)                          0.377140497  0.135923249      2.77466  0.00552598
12. A(3)                          0.375281034  0.135099724      2.77781  0.00547270
13. B(1)                          0.761236715  0.062887849     12.10467  0.00000000
14. B(2)                          0.004423171  0.019107584      0.23149  0.81693594
15. B(3)                          0.004072750  0.019120777      0.21300  0.83132595
16. DCC(1)                        0.393664956  0.045142969      8.72040  0.00000000
17. DCC(2)                        0.592641482  0.045281987     13.08780  0.00000000
\***** The problem is that I am not sure of the interpretation of the above output, then I do not have the code for Ljungbox test and Bollerslev test, conditional Correlation coefficients. Is there any diagnostic tests for the model above? please help. Sorry for asking too muck I seem not to find answers, been searching for long. Thank you in advance.
Post Reply