############################################################################### ############################################################################ ########################################################################### # # EGARCH, TGARCH, and PGARCH ... the ZOO DOORS ARE OPENED.... ################################################################################ module(finmetrics) # First, Neslson(1991) EGARCH hp.egarch = garch(hp.s~1, ~egarch(1,1), leverage=T, trace=F) hp.egarch # Just for fun calculate a t-statistic for the Leverage "by hand"... coef(hp.egarch)[5]/sqrt(vcov(hp.egarch)[5,5]) #More to the point of understanding the return series, summary(hp.garch) ################################################ # Next the TGARCH of GJR(1993) hp.tgarch = garch(hp.s~1, ~tgarch(1,1), trace=F) summary(hp.tgarch) #t-stat on coefficient coef(hp.tgarch)[5]/sqrt(vcov(hp.tgarch)[5,5]) ################################ # Next the PGARCH of Ding, Granger, Engle (1993): Case of d=1. # hp.pgarch = garch(hp.s~1, ~pgarch(1,1,1), leverage=T, trace=F) summary(hp.pgarch) # t-stat on leverage effect coef(hp.pgarch)[5]/sqrt(vcov(hp.pgarch)[5,5]) ####################################################### ####################################################### ####################################################### # Now, the so-called news impact curves # This is a theoretical object that one can view as the graph of sigma^2_t as a function of epsilon_{t-1} # conditional on everything else... # It shows the relative impact of the "news" in the various models ####################################################### a0 = hp.tgarch$coef[2] a1 = hp.tgarch$coef[3] b1 = hp.tgarch$coef[4] g1 = hp.tgarch$coef[5] A = a0 + b1*hp.tgarch$asymp.sd^2 epsilon = seq(-0.21,0.14, length=100) sigma2.t.TGARCH = A+(a1+g1*(epsilon < 0))*(epsilon^2) a0 = hp.pgarch$coef[2] a1 = hp.pgarch$coef[3] b1 = hp.pgarch$coef[4] g1 = hp.pgarch$coef[5] A = (a0 + b1*hp.pgarch$asymp.sd)^2 error = abs(epsilon) + g1*epsilon sigma2.t.PGARCH = A + 2*sqrt(A)*a1*error + (a1*error)^2 hp.garch = garch(hp.s~1, ~garch(1,1), trace=F) a0 = hp.garch$coef[2] a1 = hp.garch$coef[3] b1 = hp.garch$coef[4] #g1 = hp.garch$coef[5] #BOGUS IN TEXT A = a0 + b1*hp.garch$asymp.sd^2 error = abs(epsilon) + g1*epsilon sigma2.t.GARCH = A + a1*(error^2) matplot(cbind(epsilon, epsilon, epsilon), cbind(sigma2.t.TGARCH,sigma2.t.PGARCH,sigma2.t.GARCH), type="l") key(-0.05, 0.0045, lines=list(type="l", lty=1:3), text=list(c("TGARCH","PGARCH","GARCH")),border=1, adj=1) ##############################################################