how to modify DCC

Discussions of ARCH, GARCH, and related models

how to modify DCC

Postby UOB-rubick » Thu Aug 18, 2011 12:07 pm

dear sir
i am working on DCC modles. The original dynamic structure of DCC model is Qt=(1-a-b)S+a*error^2+bQt-1, and want to make modifications on that equation, such as changing the scalars a,b to matrix A and B, or to diagonal matrix A and B. The code for the original version is in the user's guide but it dose not mention the alternative ones. Could u kindly tell me how to complie the code so that I can modify the dynamic equation as I wanted.
In addition, I want to add structual breaks to the dynamic equation to verify whether the 2008 global financial crisis change the structure of correlations. So how to add dummies in dynamic equations. An example programm would help as well.

thanks in advance!
UOB-rubick
 
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

Re: how to modify DCC

Postby TomDoan » Thu Aug 18, 2011 1:30 pm

TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: how to modify DCC

Postby UOB-rubick » Thu Aug 18, 2011 3:11 pm

omg, that is exactly the article I resorted to. great help, thank u so much!!! :D
UOB-rubick
 
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

Re: how to modify DCC

Postby UOB-rubick » Sat Aug 20, 2011 10:49 am

Dear tom
Thx for ur help, I have a problem with the programm u give. It works well until reach the row:
frml logl = (q=qf), hh=%corrtocv(%cvtocorr(q),%xt(h,t)),%logdensity(hh,%xt(u,t))
with error instruction:
## SX11. Identifier %CORRTOCV is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>=qf), hh=%corrtocv(<<<<
is there sth wrong with the code?

best wishes
UOB-rubick
 
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

Re: how to modify DCC

Postby TomDoan » Sat Aug 20, 2011 1:52 pm

%CORRTOCV was added with RATS version 6.35.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: how to modify DCC

Postby UOB-rubick » Sat Aug 20, 2011 7:17 pm

Hi, tom, thx a lot, i have fixed the problem, but here comes another one. When i run to the final step:
maximize(start=%(bq=%const(bfix),aq=%const(afix),StartQC()),method=bfgs,title="Two-step DCC") logl gstart gend
it comes out:
## MAT15. Subscripts Too Large or Non-Positive
what does this infer?
UOB-rubick
 
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

Re: how to modify DCC

Postby UOB-rubick » Mon Aug 22, 2011 10:15 am

Dear Tom
This is the code I use, which is copied from your post 'various DCC models". Without solving this, I cant move on :( ,please help me out, gratitude for your patient. I am a novice of this.

Code: Select all
DATA(FORMAT=PRN,ORG=COLUMNS) 1 2087 UK GE FR US
compute n=4
dec vect[series] y(n)
set y(1) = us
set y(2) = ge
set y(3) = fr
set y(4) = us
dec vect[series] u(n) h(n) eps(n) eta(n)
do i=1,n
   garch(p=1,q=1,hseries=h(i),resids=u(i)) / y(i)
   set eps(i) = u(i)/sqrt(h(i))
   set eta(i) = %min(eps(i),0.0)
end do i
compute gstart=%regstart(),gend=%regend()
compute uniparms=n*%nreg
vcv(nocenter,matrix=qbar)
# eps
vcv(nocenter,matrix=nbar)
# eta

dec vect aq(n) bq(n) gq(n)
compute aq=%const(sqrt(.1))
compute bq=%const(sqrt(.85))
compute gq=%const(0.0)
dec frml[symm] qf
dec series[symm] q ee nn hh
dec symm qcmatrix
gset q  = qbar
gset ee = qbar
gset nn = nbar
gset hh = qbar
gset ee gstart gend = %outerxx(%xt(eps,t))
gset nn gstart gend = %outerxx(%xt(eta,t))
function StartQC
compute qcmatrix=qbar-%diag(aq)*qbar*%diag(aq)-%diag(bq)*qbar*%diag(bq)-%diag(gq)*nbar*%diag(gq)
eigen qcmatrix qceigen
end StartQC
frml qf   = qcmatrix+%diag(aq)*ee{1}*%diag(aq)+%diag(bq)*q{1}*%diag(bq)+%diag(gq)*nn{1}*%diag(gq)
frml logl = (q=qf),hh=%corrtocv(%cvtocorr(q),%xt(h,t)),%logdensity(hh,%xt(u,t))

compute bfix=sqrt(.85),afix=sqrt(.10)
nonlin afix bfix
compute gq=%const(0.0)
maximize(start=%(bq=%const(bfix),aq=%const(afix),StartQC()),method=bfgs,title="DCC") logl gstart gend
disp "DCC BIC" -2.0*%logl+(%nreg+uniparms)*log(%nobs)
Attachments
Dataset.txt
dataset
(112.05 KiB) Downloaded 47 times
UOB-rubick
 
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

Re: how to modify DCC

Postby TomDoan » Mon Aug 22, 2011 1:23 pm

You need to start your MAXIMIZE instruction at gstart+1 rather than gstart, since it depends upon lag one of ee, which is only defined from gstart.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to ARCH and GARCH Models

Who is online

Users browsing this forum: No registered users and 1 guest