差不多搞定了

这是我应用你先前给我的程序改过来的针对基金裕华的估计程序:
' Program to estimate a GARCH(1,1)-t model on the series yuhua.
'%path = @runpath+"../yuhua/"
'cd %yuhua
load jjsj
series d1 = 0
smpl @first @first
d1 = 1
smpl @all
'get starting values from Gaussian ARCH
equation eq1
eq1.arch yuhuat 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=yuhuat-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 quantile=@qtdist(0.95,tdf(1))
程序执行出来的结果分别如下:Dependent Variable: YUHUAT
Method: ML - ARCH (Marquardt) - Normal distribution
Date: 05/19/07 Time: 17:10
Sample: 1 199
Included observations: 199
Convergence achieved after 76 iterations
Variance backcast: ON
GARCH = C(2) + C(3)*RESID(-1)^2 + C(4)*GARCH(-1)
Coefficient Std. Error z-Statistic Prob.
C 0.171256 0.145458 1.177360 0.2391
Variance Equation
C 1.336620 0.632853 2.112056 0.0347
RESID(-1)^2 0.288061 0.105933 2.719274 0.0065
GARCH(-1) 0.490229 0.167354 2.929295 0.0034
R-squared -0.012324 Mean dependent var 0.438428
Adjusted R-squared -0.027899 S.D. dependent var 2.412696
S.E. of regression 2.446119 Akaike info criterion 4.493790
Sum squared resid 1166.783 Schwarz criterion 4.559987
Log likelihood -443.1321 Durbin-Watson stat 1.836723
LogL: LL_L
Method: Maximum Likelihood (Marquardt)
Date: 05/19/07 Time: 17:10
Sample: 1 199
Included observations: 199
Evaluation order: By observation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: MU(1)=0.17126, OMEGA(1)=1.33662, ALPHA(1)=0.2880
6, BETA(1)=0.49023, TDF(1)=3.00000
Convergence achieved after 23 iterations
Coefficient Std. Error z-Statistic Prob.
MU(1) 0.179415 0.149171 1.202750 0.2291
OMEGA(1) 1.275241 0.781697 1.631376 0.1028
ALPHA(1) 0.296658 0.134556 2.204720 0.0275
BETA(1) 0.516720 0.201011 2.570609 0.0102
TDF(1) 9.226873 9.278601 0.994425 0.3200
Log likelihood -442.3448 Akaike info criterion 4.495928
Avg. log likelihood -2.222838 Schwarz criterion 4.578674
Number of Coefs. 5 Hannan-Quinn criter. 4.529417
结果应该上半部分是残差服从正态分布下的结果吧,下半部分是残差服从t分布的结果吧,另外我把你这里的 quantile=@qtdist(0.05,tdf(1))里的0.05改成了0.95,分位数计算结果为scarlar quantile=1.827994,不知对否?
[此贴子已经被作者于2007-5-19 17:15:49编辑过]