全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 EViews专版
16863 34
2015-09-09
来自青藏高原的求助,天寒地冻。小弟最近我在做DCC-MVGARCH模型,想通过EVIEWS去实现模型的参数估计和变量的动态条件相关系数图,请问能在EVIEWS中实现吗?该如何实现?希望大神们能给出答案,有青海特产相送哦!不胜感激!
二维码

扫码加我 拉你入群

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

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

全部回复
2015-9-9 09:10:37
https://bbs.pinggu.org/thread-2259843-1-1.html
建议使用matlab做
二维码

扫码加我 拉你入群

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

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

2015-9-9 10:43:15
胖胖小龟宝 发表于 2015-9-9 09:10
https://bbs.pinggu.org/thread-2259843-1-1.html
建议使用matlab做
本人matlab小白,有木有现成的程序包,发过来下,万分感谢!
二维码

扫码加我 拉你入群

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

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

2015-9-9 16:09:31
自己顶一下  别沉了
二维码

扫码加我 拉你入群

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

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

2015-9-11 21:54:41

EViews User Forum有一连串讨论Dynamic conditional correlation multivariate GARCH 程式码。我把他整理成适合我要用的(EViews6),需要的可以试试。
程式码来源:
http://forums.eviews.com/viewtopic.php?f=4&t=574&p=40903&hilit=dcc#p40903

a)  程式码

'change path to program path
cd "C:\Program Files\EViews6\Example Files\Sample Programs\logl"


'load workfile containing the return series
load intl_fin.wf1


'set sample range
sample s0 3/1/1994 8/25/2000
sample s1 3/2/1994 8/25/2000
scalar pi=3.14159


'defining the return series in terms of y1 and y2
smpl @all
series y1 = dlog(sp500)
series y2 = dlog(tbond)


'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 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.8

' ...........................................................
' 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

b) 估计结果
output

c) 动态相关系数


graph-corr

二维码

扫码加我 拉你入群

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

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

2015-9-16 21:03:46
yenfeng1 发表于 2015-9-11 21:54
EViews User Forum有一连串讨论Dynamic conditional correlation multivariate GARCH 程式码。我把他整理 ...
   大神  你好!原谅我的知识的匮乏,你整理的程序怎么在我的电脑上运用不下来!假设我的时间序列长度为2000.01-2015.06 只要把你程序的时间序列的长度改变一下就好了吗?我把长度改变貌似还是出错!还是直接把时间序列直接弄在eviews里再运行程序!能否加我QQ 763074486!熊涛
             坐等!不胜感激!
附件列表
0Q]98L(}Q$`B$({HUU(7YCC.png

原图尺寸 2.04 KB

0Q]98L(}Q$`B$({HUU(7YCC.png

二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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