Code: Select all
OPEN DATA "C:\Documents and Settings\admin\Desktop\teze.RAT"
CALENDAR(D) 2006:1:3
DATA(FORMAT=RATS) 2006:01:03 2010:12:08 RT
smpl 2 511
garch(p=1,q=1,reg,resids=u,hseries=h) / rt
# constant rt{1}
***Testing standardized residuals
set ustd = u/sqrt(h)
set ustdsq = ustd^2
correlate(qstat,number=40,dfc=1,title="LB Test") ustd
correlate(qstat,number=40,dfc=2,title="McLeod-Li Test") ustdsq
stats ustd
***Rolling GARCH
compute width=511
dec vect[series] coeffs(4)
do gend=width,1287
if gend==width
garch(p=1,q=1,resids=u,hseries=h,noprint) gend-width+1 gend rt
else
garch(p=1,q=1,resids=u,hseries=h,initial=%beta,hessian=%xx,noprint) $
gend-width+1 gend rt
compute %pt(coeffs,gend,%beta)
end do gend