Tom
Thanx for your help. Now i am using my data as daily returns.
As reference to my previous query regarding How to forecast or calculate vols for different tenors like 1W, 2W and so on. I have asked how would i incorporate
vol^2 = VL + (alfa +beta)^7 * (variance-VL) - for calculating 1W vol. this equation in the GARCH code. And as u suggested i have used the same in my GARCH setup and got the following output.
1W Vol = 4.62400e-05
I just wanted to understand
1. whether this number is the 1W vol from 31dec 2010 as last data point in my data set is asof 31dec 2010.
2. Also, above equation we are solving for vol^2 so to calculate vol we have to take
sqrt(4.62400e-05).
3. variance = 1D vol which we have calculated using daily returns by standard GARCH formula.
4. What is h(gend) ?
Following is my code:
Code: Select all
cal(DAILY) 2006 1 3
all 2010:12:31
open data Rates2_returns.xls
data(format=xls,org=cols)
*
compute gstart=2,gend=2010:12:31
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) GAMMA VL VA VB GAMMA=1-VA-VB
FRML HF = GAMMA*VL + 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 VL=%SEESQ,VA=.85,VB=.05
COMPUTE volsq=VL+(VA+VB)**7*(h(gend)-VL)
disp "1W Vol = " volsq
SET H = %SEESQ
MAXIMIZE(parmset=meanparms+garchparms,METHOD=SIMPLEX,ITERS=5,NOPRINT) LOGL GSTART GEND
MAXIMIZE(parmset=meanparms+garchparms,METHOD=Bfgs,robusterrors,ITERS=1000) LOGL GSTART GEND
Output is
# SR12. We recommend File-Clear Program or END xxx before ALLOCATE
1W Vol = 4.68308e-05
MAXIMIZE - Estimation by BFGS
Convergence in 17 Iterations. Final criterion was 0.0000000 < 0.0000100
Daily(5) Data From 2006:01:04 To 2010:12:31
Usable Observations 1303
Function Value 6027.52275112
Variable Coeff Std Error T-Stat Signif
******************************************************************************************
1. B0 0.0002317189 0.0001318932 1.75687 0.07894043
2. GAMMA 0.0015639114 0.0036209495 0.43191 0.66580941
3. VL 0.0000633971 0.0001087785 0.58281 0.56002194
4. VA 0.9566225868 0.0068654456 139.33875 0.00000000
5. VB 0.0418135018 0.0064666280 6.46604 0.00000000