how to modify DCC

Discussions of ARCH, GARCH, and related models
UOB-rubick
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

how to modify DCC

Unread post by UOB-rubick »

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!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: how to modify DCC

Unread post by TomDoan »

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

Re: how to modify DCC

Unread post by UOB-rubick »

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

Unread post by UOB-rubick »

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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: how to modify DCC

Unread post by TomDoan »

%CORRTOCV was added with RATS version 6.35.
UOB-rubick
Posts: 5
Joined: Wed Aug 17, 2011 12:23 pm

Re: how to modify DCC

Unread post by UOB-rubick »

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

Unread post by UOB-rubick »

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 750 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: how to modify DCC

Unread post by TomDoan »

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.
Post Reply