在对第三只基金基金同智做回归时碰到这样的问题:
这是我改过的程序:
' Program to estimate a GARCH(1,1)-t model on the series tongzhi.
'%path = @runpath+"../tongzhi/"
'cd %tongzhi
load tongzhi
series d1 = 0
smpl @first @first
d1 = 1
smpl @all
'get starting values from Gaussian ARCH
equation eq1
eq1.arch tongzhi c
show eq1.output
'declare and innitialize parameters
coef(1) mu = eq1.c(1)
coef(1) omega = eq1.c(2)
coef(1) alpha =eq1.c(3)
coef(1) beta =eq1.c(4)
coef(1) tdf=3
!pi=@acos(-1)
'set up GARCH(1,1)-t likelihood
logl ll_l
ll_l.append @logl logl
ll_l.append res=tongzhi-mu(1)
ll_l.append sig2 =@recode(d1=1,omega(1)/(1-alpha(1)-beta(1)),omega(1)+alpha(1)*res(-1)^2+beta(1)*sig2(-1))
ll_l.append z =res^2/sig2/(tdf(1)-2)+1
ll_l.append logl = @gammalog((tdf(1)+1)/2)-@gammalog(tdf(1)/2)-log(!pi)/2-log(tdf(1)-2)/2-log(sig2)/2 - (tdf(1)+1)*log(z)/2
'estimate and display output
ll_l.ml(showopts,m=1000,c=1e-5)
show ll_l.output
scalar quantiletongzhi1=@qtdist(0.95,tdf(1))
scalar quantiletongzhi2=@qtdist(0.99,tdf(1))
这是数据:
118560.rar
(173.05 KB)
本附件包括:- 毕业论文数据 未定.xls


雷达卡
京公网安备 11010802022788号







