Page 1 of 1

DCC Garch modelling Eviews 7

Posted: Thu Jul 31, 2014 5:52 am
by charliearblaster
Hello,

I got a question on the DCC-GARCH nonnegative scalar parameters. After running this programme code, I got negative scalar thetas, not sure what causes this to happen. Per the literature review, I know this should not be. Can someone give me a bit clue on this? I'm very desperate for this to be resolved for dissertation.

this is the code I'm running, could this be the problem and if so would someone explain please

'change path to program path
%path=@runpath
cd %path

'load workfile containing the return series
load Post_2011.WF1

'set sample range
sample s1 07/26/2005 12/31/2011
scalar pi=3.14159

'defining the return series in terms of y1 and y2
series y1=dl_ex
series y2=dl_sp

'fitting univariate GARCH(1,1) models to each of the two returns series
equation eq_y1.arch(1,1,m=1000,h) y1 c dl_ex(-1)
equation eq_y2.arch(1,1,m=1000,h) y2 c dl_sp(-1)

'extract the standardized residual series from the GARCH fit
eq_y1.makeresids(s) z1
eq_y2.makeresids(s) z2

'extract garch series from univariate fit
eq_y1.makegarch() garch1
eq_y2.makegarch() garch2

'Caculate sample variance of series z1, z2 and covariance of z1and z2 and correlation between z1 and z2
scalar var_z1=@var(z1)
scalar var_z2=@var(z2)
scalar cov_z1z2=@cov(z1,z2)
scalar corr12=@cor(z1,z2)

'defining the starting values for the var(z1) var(z2) and covariance (z1,z2)
series var_z1t=var_z1
series var_z2t=var_z2
series cov_z1tz2t=cov_z1z2

'declare the coefficient starting values
coef(2) T
T(1)=0.2
T(2)=0.7

' ...........................................................
' LOG LIKELIHOOD for correlation part
' set up the likelihood
' 1) open a new blank likelihood object and name it 'dcc'
' 2) specify the log likelihood model by append
' ...........................................................

logl dcc
dcc.append @logl logl

'specify var_z1t, var_z2t, cov_z1tz2t
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)

'specify rho12
dcc.append rho12=cov_z1tz2t/@sqrt(@abs(var_z1t*var_z2t))

'defining the determinant of correlation matrix and determinant of Dt
dcc.append detrRt=(1-(rho12^2))
dcc.append detrDt=@sqrt(garch1*garch2)
dcc.append pen=pen+(detrRt<0)
dcc.append detrRt=@abs(detrRt)

'define the log likelihood function
dcc.append logl=(-1/2)*(2*log(2*pi)+log(detrRt)+(z1^2+z2^2-2*rho12*z1*z2)/detrRt)-10*pen

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

'display output and graphs
show dcc.output
graph corr.line rho12

LogL: DCC
Method: Maximum Likelihood (Marquardt)
Date: 07/30/14 Time: 11:24
Sample: 7/26/2005 12/30/2011
Included observations: 1679
Evaluation order: By observation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: T(1)=0.20000, T(2)=0.70000
Convergence achieved after 26 iterations

Coefficient Std. Error z-Statistic Prob.

T(1) -0.029642 0.005444 -5.444883 0.0000
T(2) 0.562296 0.460843 1.220147 0.2224

Log likelihood -4547.708 Akaike info criterion 5.419545
Avg. log likelihood -2.708581 Schwarz criterion 5.426008
Number of Coefs. 2 Hannan-Quinn criter. 5.421939