全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 EViews专版
4142 3
2013-04-27
最近在做毕业论文,选的是DCC-GARCH研究股市与汇市的波动溢出效应,(日收益率和汇率间)
在进行DCC建模时,一直出现
Missing values in @LOGL at current coefficients at observation 1 in"Do-dcc.ml(showopts, m=500, c=1e-5)".  

第一次做真不知道哪错了,请大家帮帮忙


不知道怎么上传附件,就把程序贴出来了~
--------------------------------------------------------------------

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

'load workfile containing the return series
load volality.WF1

'set sample range
sample s1 1 2321
scalar pi=3.14159

'defining the return series in terms of y1 and y2
series y1=totmkhk
series y2=dusd_hkd

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

'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 z1 and 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
show corr

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-5-17 17:16:29
你再多试几次,试一下菜单操作
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-12-13 09:56:50
ermutuxia 发表于 2013-5-17 17:16
你再多试几次,试一下菜单操作
我已经用R软件实现DCC-GARCH模型,有兴趣加我qq: 2304105337
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-4-25 16:10:02
您好,你可以教一下我怎么用dcc garch吗,大脑一片空白啊现在
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群