regarding the results that mgarch dcc produces
Posted: Sat Jun 13, 2015 12:43 am
Hello,
Below are the codes for my unstructured data
I have got 2668 observations but the codes produce 2667 correlations. The first value is given as "NA". If I only write "s1 1 2668" then it does not calculate the logl. So the best result I get comes with the codes below. I would like to ask whether the correlations produced are in line with the observations and there is no skid. I mean does the
second value of correlations is the result of the first two observations and not just the first observation? Because for my dissertation I compare several methods and the results of the observations must be in line.
smpl @all
s0 1 2668
s1 2 2668
scalar pi=3.14159
series y1=usd_eur
series y2=usd_gbp
equation eq_y1.arch(1,1,m=1000,h) y1 c
equation eq_y2.arch(1,1,m=1000,h) y2 c
eq_y1.makeresids(s) z1
eq_y2.makeresids(s) z2
eq_y1.makegarch() garch1
eq_y2.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
logl dcc
dcc.append @logl logl 41
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 logl=(-1/2)*(2*log(2*pi)+log(detrRt)+(z1^2+z2^2-2*rho12*z1*z2)/detrRt)-10*pen
smpl s1
dcc.ml(showopts, m=500, c=1e-5)
show dcc.output
graph corr.line rho12
show corr
Below are the codes for my unstructured data
I have got 2668 observations but the codes produce 2667 correlations. The first value is given as "NA". If I only write "s1 1 2668" then it does not calculate the logl. So the best result I get comes with the codes below. I would like to ask whether the correlations produced are in line with the observations and there is no skid. I mean does the
second value of correlations is the result of the first two observations and not just the first observation? Because for my dissertation I compare several methods and the results of the observations must be in line.
smpl @all
s0 1 2668
s1 2 2668
scalar pi=3.14159
series y1=usd_eur
series y2=usd_gbp
equation eq_y1.arch(1,1,m=1000,h) y1 c
equation eq_y2.arch(1,1,m=1000,h) y2 c
eq_y1.makeresids(s) z1
eq_y2.makeresids(s) z2
eq_y1.makegarch() garch1
eq_y2.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
logl dcc
dcc.append @logl logl 41
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 logl=(-1/2)*(2*log(2*pi)+log(detrRt)+(z1^2+z2^2-2*rho12*z1*z2)/detrRt)-10*pen
smpl s1
dcc.ml(showopts, m=500, c=1e-5)
show dcc.output
graph corr.line rho12
show corr