I am using following GARCH code for estimating volatility:
- Code: Select all
cal 1986 1 12
all 1996:12
open data returns.xls
data(format=xls,org=cols)
*
compute gstart=2,gend=1996:12
set y = sp500
*
nonlin(parmset=meanparms) b0
frml resid = y - b0
declare series u ;* Residuals
declare series h ;* Variances
*
* GARCH(1,1) with initial variance from regression
*
NONLIN(parmset=garchparms) VC VA VB
FRML HF = VC + VA*H{1} + VB*U{1}**2
FRML LOGL = (H(T)=HF(T)),(U(T)=RESID(T)),-.5*(log(h)+u**2/h)
LINREG(NOPRINT) Y / U
# CONSTANT
COMPUTE B0=%BETA(1)
COMPUTE VC=%SEESQ,VA=.05,VB=.05
SET H = %SEESQ
MAXIMIZE(parmset=meanparms+garchparms,METHOD=SIMPLEX,ITERS=5,NOPRINT) LOGL GSTART GEND
MAXIMIZE(parmset=meanparms+garchparms,METHOD=Bfgs,robusterrors,ITERS=100) LOGL GSTART GEND
I have taken a base as John Hull book formula which is as follows:
sigma^2 = gamma*VL + alfa*u^2 (n-1)+ beta * sigma^2 (n-1).
How do i correlate the above code with this formula. Also, from initial inspection it appears that VB = alfa and VA = beta.
But one of the fundamental assumption in the John - Hull book is that gamma + alfa + beta = 1.
So how do i incorporate this constraint in the above code.
Thanx
