大家好,第一次发帖向论坛上各位前辈求助
明年毕业论文有一个部分要做FWD和NDF两个历史汇率数据之间的信息传递关系研究,所以要用到基于T分布的双变量EGARCH模型。导师最近给了我一段好像是正态分布的双变量EGARCH EVIEWS程序,要求在这个基础上进行修改,但是本人实在对于EVIEWS理解程度不够,很多都搞不懂。
以下是程序
'Bivariate. Egarch model with normal distribtion
'load workfile
load d:\rmb\eviews\data\onemonth.wf1
'set samples
!start= 8/02/2005
!end= 10/31/2007
smpl @all
series y1=dlog(fwd)
series y2=dlog(ndf)
sample s1 8/2/2005 10/31/2007
sample s2 8/5/2005 10/31/2007
sample s3 8/2/2005 10/31/2007
'set series
'declare coefficients
coef(2) beta0
beta0(1)=0.001
beta0(2)=0.001
coef(4) beta
beta(1)=-0.2
beta(2)=0.3
beta(3)=0.2
beta(4)=-0.2
coef(2) lambda
lambda(1)=0.2
lambda(2)=0.2
coef(2) alpha0
alpha0(1)=0.001
alpha0(2)=0.001
coef(2) gamma
gamma(1)=0.5
gamma(2)=0.5
coef(4) alpha
alpha(1)=0.001
alpha(2)=0.3
alpha(3)=0.001
alpha(4)=0.2
coef(2) delta
delta(1)=-0.1
delta(2)=-0.01
coef(2) ef
ef(1)=0.2
ef(2)=0.1
coef(1) c0
c0(1)=0.01
coef(1) ci
ci(1)=0.04
coef(1) g
g(1)=0.7
coef(9) dum
'dum(1)=0.001 'beta(2)
'dum(2)=0.001 'lambda(1)
'dum(3)=0.001 'beta(3)
'dum(4)=0.001 'lambda(2)
'dum(5)=0.001 'alppha(2)
'dum(6)=0.001 'ef(1)
'dum(7)=0.001 'alpha(4)
'dum(8)=0.001 'ef(2)
'dum(9)=0.001 'c(1)
!pi = @acos(-1)
!absz=sqr(2/!pi)
'set presample values of expressions in logl
smpl s1
series res1=y1-beta0(1)-beta(1)*y1(-1)-beta(2)*y2(-1)
series res2=y2-beta0(2)-(beta(3))*y1(-1)-beta(4)*y2(-1)
!var1=(@stdev(res1))^2
!var2=(@stdev(res2))^2
!correlation=@cor(y1,y2)
series h11=!var1
series h22=!var2
series rho=!correlation
series h12=2*rho*sqr(h11)*sqr(h22)
series deth=h11*h22-h12*h12
series invh11=h22/deth
series invh12=-h12/deth
series invh22=h11/deth
'set up EGARCH likelihood
smpl s2
logl ll1
ll1.append @logl logl
@byeqn
ll1.append res1=y1-beta0(1)-beta(1)*y1(-1)-beta(2)*y2(-1)
ll1.append res2=y2-beta0(2)-beta(3)*y1(-1)-beta(4)*y2(-1)
ll1.append h11=exp(alpha0(1)+gamma(1)*log(h11(-1))+alpha(1)*(abs(res1(-1)/sqr(h11(-1)))-!absz+delta(1)*((res1(-1)/sqr(h11(-1)))))+alpha(2)*(abs(res2(-1)/sqr(h22(-1)))-!absz+delta(2)*((res2(-1)/sqr(h22(-1))))))
ll1.append h22=exp(alpha0(2)+gamma(2)*log(h22(-1))+alpha(3)*(abs(res2(-1)/sqr(h22(-1)))-!absz+delta(2)*((res2(-1)/sqr(h22(-1)))))+(alpha(4))*(abs(res1(-1)/sqr(h11(-1)))-!absz+delta(1)*((res1(-1)/sqr(h11(-1))))))
ll1.append rho=@cor(res1,res2)
ll1.append h12=rho*sqr(h11)*sqr(h22)
ll1.append deth=h11*h22-h12*h12
ll1.append invh11=h22/deth
ll1.append invh12=-h12/deth
ll1.append invh22=h11/deth
ll1.append likelihoods=log(deth)+(res1^2)*invh11+(res2^2)*invh22+2*res1*res2*invh12
ll1.append logl=-log(2*!pi)-0.5*likelihoods
ll1.append z1=res1/sqr(h11)
ll1.append z2=res2/sqr(h22)
ll1.append z11=(res1^2)/h11
ll1.append z22=(res2^2)/h22
ll1.append z12=z1*z2
' estimate and display output
smpl s2
ll1.ml(showopts,m=100,c=1e-5)
show ll1.output
我不知道这个程序是否已经能够实现用BHHH算法的极大似然估计双变量EGARCH模型,因为我直接运行这个程序弹出一个警告窗口,missing values in @logl series at current coefiicients at observation 1 in “DO_LL1.ML(showopts,M=100,C=1E-5)",不知道是什么原因?
如果要实现基于T分布的双变量EGARCH,如何在次基础上进行修改?
最后一个问题:我论文后面一部分要求应用SUR(表面无关回归)对该模型进行分析,检测不同变量的回归解释能力,以检验基于T分布的双变量EGARCH模型的稳健性,我查了好久都没有找到相关的资料,不知道如何用EVIEWS来实现。
一下子提了那么多问题,还请论坛上的各位前辈多多赐教,小女子在这里感激涕零,谢谢!!