
'Estimate GARCH(1,1) model with t-distributed errors
'change path to program path
%path=@runpath
cd"{%path}"
'load workfile
load F:\fyl\bylw\jjsj
series y=fa
set sample to 2 202
sample s0 2 2
sample s1 3 202
smpl s1
'get starting values from Gaussian ARCH
equation eq1
eq1.arch y 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
' set presample values of expressions in logl
smpl s0
series sig2 = omega(1)
series res = 0
!pi = @acos(-1)
'set up GARCH likelihood
logl ll l
ll l.append @logl logl
ll l.append sig2 =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
smpl s1
ll l.ml(showopts,m=1000,c=le-5)
show ll l.output
上面是程序,运行时老是告诉我是非法名字,这是怎么回事,我抓拍的问题图片在附件里谢谢各位拉!
此主题相关图片如下:


雷达卡



京公网安备 11010802022788号







