Dynamic conditional correlation multivariate GARCH

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby trubador » Mon Aug 12, 2013 11:54 pm

Rosen89 wrote:This is when I get up that I have missing values -- again, if anybody has time to help I would very much appreciate it

It is difficult to detect the source of the problem without seeing the actual workfile, but I am fairly sure that you'll find the solution here: Missing value problem in a Bivariate GARCH model.

Rosen89
Posts: 2
Joined: Mon Aug 12, 2013 12:37 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby Rosen89 » Tue Aug 13, 2013 1:40 am

Attached is the workfile -- do I have any mistakes?

hellena88
Posts: 1
Joined: Sat Aug 17, 2013 6:28 am

Re: Dynamic conditional correlation multivariate GARCH

Postby hellena88 » Thu Sep 05, 2013 6:44 am

hi, i've figure out the programming, but im not really sure about my code i'm running research for 5 countries using DCC-GRACH. im not sure if my code is correct or not.. but so far its going ok.. but.. the dcc part is not appearing result. yet when its come to modelling estimation its turn out unmatched parenthesis. can somebody help me to figure out where did i did it wrong? :cry: :cry:

dcc.ml(showopts,m=500, c=1e-5)
show dcc.output
graph corr.line rho12
show corr
Attachments
eview code for dcc-grach.prg
(2.55 KiB) Downloaded 1216 times

sym
Posts: 2
Joined: Mon Aug 19, 2013 5:33 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby sym » Sat Nov 02, 2013 9:14 pm

rosen89,

as someone said above "you should use "smpl sf" instead of "smpl s1" before calling the estimation algorithm", that is, you need to define sample s1 and s2. Check logl series on your workfile, the first value is NA, then you should use s2 = 2 to n (s1 = 1 to n).
write smpl s2 before dcc.ml.... instrucction

'estimate the model
smpl s2
dcc.ml(showopts, m=500, c=1e-5)

sotim
Posts: 1
Joined: Tue Dec 31, 2013 9:52 am

Re: Dynamic conditional correlation multivariate GARCH

Postby sotim » Tue Dec 31, 2013 10:05 am

Hello,

I used the attached code for a 5x5 system for my thesis.

It works.

Good Luck,

Michail
Attachments
DCC MGARCH Code.txt
(15.03 KiB) Downloaded 1318 times

cherryblossom
Posts: 1
Joined: Tue Feb 25, 2014 9:37 am

Re: Dynamic conditional correlation multivariate GARCH

Postby cherryblossom » Tue Feb 25, 2014 10:13 am

Dear all,
I'm a new user and I'm doing a research using DCC Garch.
I used the code posted by Hvtcapollo (thanks for your code ^^) and I got an error message. It said that "missing value in @ LOGL series at current coeficients at observations 1980M02 in "Do_DCC.ML(Showopts, M=500,C=1E-5)" ". My sample: 1980M02-2013M11.
Did I do st wrong? Please help me !!!

By the way, how can i get the time-varying conditional correlation series ?

I really appreciate if someone guide me.
Thank You.

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Dynamic conditional correlation multivariate GARCH

Postby misscats » Wed Apr 02, 2014 4:30 am

I use the codes provided here and modify to my need. It works through.

As I want to have the result of dynamic conditional correlation of variances, is it the value of corr12? If so, it is odd, as it doesn't change after the logl dcc estimation. Is this correct? Or, should I calculate it on my own with the two estimated series of variances?

For convenience, I attach the code here.

Code: Select all

series r1=nasdaq_return
series r2=bse_return

sample s1 2 @last
scalar pi=3.14159

equation eq_r1.arch(1,1,m=1000,h) r1 c
equation eq_r2.arch(1,1,m=1000,h) r2 c
eq_r1.makeresids(s) z1
eq_r2.makeresids(s) z2
eq_r1.makegarch() garch1
eq_r2.makegarch() garch2

scalar var_z1=@var(z1)
scalar var_z2=@var(z2)
scalar cov_z1z2=@cov(z1,z2)
scalar corr12=@cor(z1,z2)
series var_z1t=var_z1
series var_z2t=var_z2
series cov_z1tz2t=cov_z1z2

coef(2) T
T(1)=0.2
T(2)=0.7

logl dcc
dcc.append @logl logl
dcc.append var_z1t=@nan(1-T(1)-T(2)+T(1)*(z1(-1)^2)+T(2)*var_z1t(-1),1)
dcc.append var_z2t=@nan(1-T(1)-T(2)+T(1)*(z2(-1)^2)+T(2)*var_z2t(-1),1)
dcc.append cov_z1tz2t=@nan((1-T(1)-T(2))*corr12+T(1)*z1(-1)*z2(-1)+T(2)*cov_z1tz2t(-1),1)

dcc.append pen=(var_z1t<0)+(var_z2t<0)
dcc.append rho12=cov_z1tz2t/@sqrt(@abs(var_z1t*var_z2t))
dcc.append detrRt=(1-(rho12^2))

dcc.append detrDt=@sqrt(garch1*garch2)
dcc.append pen=pen+(detrRt<0)
dcc.append detrRt=@abs(detrRt)
dcc.append detrRt=(1-(rho12^2))
dcc.append detrDt=@sqrt(garch1*garch2)
dcc.append logl=(-1/2)*(2*log(2*pi)+log(detrRt)+(z1^2+z2^2-2*rho12*z1*z2)/detrRt)-10*pen

'sample s1
scalar pi=3.14159

smpl s1
dcc.ml(showopts, m=500, c=1e-5)
show dcc.output


trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby trubador » Wed Apr 02, 2014 5:24 am

Conditional correlations are stored in rho12.

Again, I suggest you to use DCCGARCH11 add-in for this purpose.

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Dynamic conditional correlation multivariate GARCH

Postby misscats » Wed Apr 02, 2014 6:33 am

Hi trubador

I checked DCCGARCH11 add-in and I need to arrange someone to upgrade my Eviews(7) to Eviews 8 from the work. So far, I only can read the DCCGARCH11 add-in documentary.

I have some questions regarding to it:
(1) I just finished the coding (with a lot of your help) and got some results. I expect the dynamic conditional correlation is one number, rather than a series (of rho12). I know that because of dynamic, the conditional correlation varies. But I check with Stata programe and the table will only show one figure between two series. From your answer, is the programming and estimating not done yet?

(2) The DCCGARCH11 add-in is to "replace" my dcc codes or to help me continue estimating something?

(3) Can DCCGARCH11 include two equations which contain difference independent variables (and the numbers of independent variables are also different)? If so, how to assign them in. It would be appreciated to point out how to assign two equations in the first box of the dialog (shown in the documentary). What i mean is, for example, i have equation 1: y1 c x1 x2 x3(-1) dummy1 h1(-1) and equation 2: y2 c x3(-1) h2(-1) as two mean equations where h1, h2 are garch-in-mean. In the first box, how should I type them in? something like?
y1 y2
And in the second box:
(c x2 x3(-1) dummy 1 h1(-1)) (c x3(-1) h2(-1))
and in the fourth box (I only need dummy1 to be in the equation 1, not in the equation 2):
(dummy1)
Last edited by misscats on Wed Apr 02, 2014 7:06 am, edited 1 time in total.

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby trubador » Wed Apr 02, 2014 7:05 am

1) Correlation should change over time in order to be dynamic.
2) http://www.eviews.com/Addins/addins.shtml
3) No, you cannot impose seperate structures (e.g. like VAR). You can include all explanatory variables at once. Insignificant ones will turn out to have small t-values.

Please keep in mind that the sole purpose of these discussions are just to help you fill in the blanks. Therefore, you are assumed to have a basic understanding of the software as well as the method you are trying to employ.

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Dynamic conditional correlation multivariate GARCH

Postby misscats » Wed Apr 02, 2014 7:13 am

trubador wrote:1) Correlation should change over time in order to be dynamic.
2) http://www.eviews.com/Addins/addins.shtml
3) No, you cannot impose seperate structures (e.g. like VAR). You can include all explanatory variables at once. Insignificant ones will turn out to have small t-values.

Please keep in mind that the sole purpose of these discussions are just to help you fill in the blanks. Therefore, you are assumed to have a basic understanding of the software as well as the method you are trying to employ.


Many thanks trubador. I do search many keywords in this forum before I raise my question.

I know that, because of dynamic, the conditional correlation varies. But I check with Stata programe and the dcc table only shows one correlation between two series. (you can download the file here: http://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CDIQFjAB&url=http%3A%2F%2Fwww.stata.com%2Fstata-news%2Fstatanews.27.3.pdf&ei=CBo8U9rOBNOB7QaVxIHIDg&usg=AFQjCNFcvZgTtylgBawHZDPOAhlfOfVPmw&bvm=bv.63934634,d.ZGU ) Why?

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby trubador » Wed Apr 02, 2014 7:29 am

The forum will only be helpful in implementing DCC (or any other) model in EViews. You should refer to a textbook or the original paper in order to understand the model itself.

Dynamic corelations are plotted in page 3 of the file you cited. The number in table may show the average estimated correlation or the final value, or something else. You should check this with Stata people.

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Dynamic conditional correlation multivariate GARCH

Postby misscats » Wed Apr 02, 2014 7:58 am

Sorry about that.
Many many thanks for your help and patient! :)

jeremym
Posts: 3
Joined: Mon Mar 24, 2014 4:43 am

Re: Dynamic conditional correlation multivariate GARCH

Postby jeremym » Wed Apr 02, 2014 1:43 pm

Hello,
I try to use the add-in and I have one question about it. There are two parameters in the model of engle: alpha and beta. IF Alpha + Beta tends to 1, then the correlations are persistent. I can't find in the "files" : dccout, rho ... created by the add-in the value of theses parameters. Can you help me to find them ? I suppose they appear with an other name.

I launch the add-in with "standard options". For example i didn't change the lag which is by default 0. What does "Number of AR lags to be used in mean equations" mean ? I use this add-in in order to check the dynamic correlation between the daily volatility of the returns of the cac 40 and of the crb (commodity index).

Thank you for your help ! :D

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Dynamic conditional correlation multivariate GARCH

Postby trubador » Wed Apr 02, 2014 2:29 pm

Alpha and beta corresponds to theta(1) and theta(2) under correlation targeting model. If you relax this assumption, then an additional coefficient (constant) will be estimated and reported as theta(3). If you choose student's t distribution, the degrees-of-freedom parameter will be shown as theta(4). And so on... You'll easily figure out with a little bit of experimenting. The footnote in the output table also refers to the stability condition, alpha+beta < 1.
Dynamic correlation models work on the variances of residuals that are obtained from the mean equations. For stationary series only a constant would be enough, but in other cases one might need to include autoregressive terms and/or explanatory variables to make residuals stationary.

Note to moderators: I kindly ask you to move this post to DCCGARCH11 thread, where it would be helpful to other users as well.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 17 guests