Welcome to THETAWIKI. If you like to create or edit a page please make sure to login or register an account. All registered users please make sure to provide a valid email address.

GARCH

From ThetaWiki
Jump to: navigation, search

GARCH Model Overview

Generalized Auto Regressive Conditional Heteroskedasticity (GARCH) (Bollerslev, 1986) models are designed to capture the fat tail and volatility clustering features of financial time series.

GARCH model is a generalization of the Auto Regressive Moving Average (ARMA) model developed in Engle (1982):

$ y_t = C + \sum_{i=1}^n{\phi_i y_{t-i}} + \varepsilon_t + \sum_{j=1}^m{\theta_j \varepsilon_{t-i}}, \qquad (1) $

where $ y_t $ denotes financial returns at time $ t $, $ C $ is the constant conditional mean, $ \phi_i $ are the autoregressive coefficients, $ \theta_j $ the moving average coefficients and $ \varepsilon_t $ the innovations at time $ t $.

The conditional variance process of the innovations $ \sigma_t^2 = E_{t-1}(\varepsilon_t^2) $ with order $ (P, Q) $ is formulated as

$ \sigma_t^2 = \kappa + \sum_{i=1}^P G_i \sigma_{t-i} + \sum_{j=1}^Q A_j \varepsilon_{t-j}^2, \qquad (2) $

where the parameters have the following constraints:

$ \sum_{i=1}^P G_i+\sum_{j=1}^Q A_j < 1, $
$ \kappa \geq 0, $
$ G_i \geq 0, \mbox{ i=1,2,....P }, $
$ A_j \geq 0, \mbox{ j=1,2,....Q }. \qquad (3) $

In equation (3), the sum of the coefficients $ \sum_{i=1}^P G_i $ and $ \sum_{j=1}^Q A_j $ should be less than 1 to ensure that the variance process is not an integrated order 1 process. The term $ \kappa $ is interpreted as long term variance.

ThetaML Implementation of GARCH Variance Process

The following is a ThetaML implementation of the GARCH volatility model defined in equation (3).

model GARCH11
%GARCH(1,1) variance process
%Example input parameters:
%S0 = 100, R0 = 0.2, V0 = 0.4^2/250
%phi = 0, tht = 0, C = 3.9e-4,
%ARCH = 0.079, GRCH = 0.91, Kappa = 1.69e-6,
%DT_gch = 1/250, t = 1
	import S0       "Initial stock price"
	import R0       "Initial value of the stock returns"
	import V0       "Initial value of the variance process"
	import phi      "Autoregressive coefficients of the return series"
	import tht      "Moving average coefficients of the return series"
	import C        "Constant of the return series"
	import ARCH     "ARCH parameter of the conditional variance process"
	import GRCH     "GARCH parameter of the conditional variance process"
	import Kappa    "Kappa constant of the conditional variance process"
	import DT_gch   "Time step for updating the GARCH process"
	import t        "Process simulation time horizon"
	export S        "Stock prices with GARCH variances"
	export Vt       "GARCH variance process"
 
 
	S = S0          %initial stock prices
	Vt = V0         %initial variance
 
	%initial innovations for the ARMA return process
	eps_m = sqrt(V0)* randn()
	%initial returns for the ARMA process
	R_n = R0
 
	%GARCH variance process simulation
 
	%loop t/DT_gch times
	loop t/DT_gch
		%theta advances time by DT_gch time step
		theta DT_gch
		Z = sqrt(Vt) * randn() %sample innovations
                R_tmp = C + phi*R_n + tht*eps_m + Z          %update return series
		GRCH_fct = Vt*GRCH                           %GARCH term
		ARCH_fct = (R_tmp - C - phi*R_n - tht*eps_m)^2*ARCH   %ARCH term
		Vt = max(0, Kappa + GRCH_fct + ARCH_fct);    %GARCH variance
 
		S = S * exp(R_tmp)  %update stock prices
 
		%update innovations
		eps_m = Z
		%updating returns
		R_n = R_tmp
	end
end


References

[1] Bollerslev, T., 1986, Generalized Autoregressive Conditional Heteroskedasticity, Journal of Econometrics, Vol.31 No.3, p 307-327.

[2] Engle, R., 1982, Autorregressive Conditional Heteroskedasticity with Estimates of United Kingdom Inflation, Econometrica, 50, p 987-1008.