GARCH(1,1) using Max instruction

Discussions of ARCH, GARCH, and related models
sulong
Posts: 13
Joined: Sun Mar 20, 2011 1:59 am

GARCH(1,1) using Max instruction

Unread post by sulong »

Tom,
What is wrong with my instructions ( please see below )?
The output i get is different from the output generated from the GRACH instruction.
I am trying to use the MAX instruction for a GARCH(1,1) process.

Many thanks,
sulong

Code: Select all

OPEN DATA "/Applications/RATS 8.0/Examples/garch.asc"
DATA(FORMAT=PRN,NOLABELS,ORG=COLUMNS) 1 1867 BP CD DM JY SF
table

set dlogdm = 100*log(dm/dm{1})


set temp = 0.0
nonlin a0 b0 b1 b2
frml ep = dlogdm - a0
frml h = b0 +  b1*(ep{1}**2) +  b2*temp{1}
frml L = (temp=h), -0.5*log(h) - ep**2/h

com a0=1, b0=1, b1=1, b2=1
max L 4 *


GARCH(P=1,Q=1) / DLOGDM
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GARCH(1,1) using Max instruction

Unread post by TomDoan »

You have differences in the sample range (your MAX code starts at 4, GARCH at 2) and your pre-sample values. The following will produce exactly the calculations done by GARCH (though I wouldn't recommend b1=1 and b2=1 as guess values; that gives an explosive variance process).

Code: Select all

OPEN DATA "/Applications/RATS 8.0/Examples/garch.asc"
DATA(FORMAT=PRN,NOLABELS,ORG=COLUMNS) 1 1867 BP CD DM JY SF
table

set dlogdm = 100*log(dm/dm{1})
linreg dlogdm
# constant
*
set uu   = %sigmasq
set temp = %sigmasq
*
nonlin a0 b0 b1 b2
frml ep = dlogdm - a0
frml h = b0 +  b1*uu{1} +  b2*temp{1}
frml L = (temp=h),uu=ep^2, %logdensity(h,ep)

com a0=1, b0=1, b1=1, b2=1
max L 2 *

GARCH(P=1,Q=1) / DLOGDM
Post Reply