GARCH

From ThetaWiki

Jump to: navigation, search

Contents

[edit] Overview

Generalized Auto Regressive Conditional Heteroskedasticity (GARCH) models are designed to capture characteristics like fat tails and volatility clustering associated with the financial time-series.

[edit] Conditional Mean and Variance Models

The ARMA model is given as

y_t=C+\sum{\phi_i y_{t-i}}+\varepsilon_t+\sum{\theta_j \varepsilon_{t-i}}

where C is a constant, φi are the autoregressive coefficients, θj the moving average coefficients and \varepsilon_t the innovations.

[edit] Conditional Variance Model

The conditional variance of the innovations \sigma_t^2 is defined as

Var_{t-1}(y_t)=E_{t-1}(\varepsilon_t^2)=\sigma_t^2

[edit] GARCH(P,Q) Conditional Variance

The general GARCH(P,Q) model for the conditional variance of innovations is given as

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

with constraints

\sum_{i=1}^P G_i+\sum_{i=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 }

[edit] Process simulation

[edit] ThetaScript implementation of GARCH volatility

Model GARCHPQ
	% Generalized GARCH(P,Q) with brownian bridge for subsampling
	import So 	"Initial Stock Price"
	import EURo     "Initial value of Numeraire"
	import Ro	"Return series"
	import Vo	"Initial volatility series"
	import r 	"Risk free rate"
	import phi 	"Autoregressive Coefficients"
	import tht	"Moving Average Coefficients"
	import C	"Constant"
	import ARCH	"ARCH value"
	import GRCH	"GARCH value"
	import Kappa    "Kappa"
	import DT_gch   "Time step for GARCH"
 
	export S 	"Stock price"
	export EUR 	"Numeraire"
	export Vr 	"Volatiliy"
 
 
	S=So
	S_g=So
	EUR=EURo
	Vt=Vo %initial volatility series.
	%Assigning the values to variables
	P=length(GRCH)
	Q=length(ARCH)
	N=length(phi)
	M=length(tht)
	Vr=Vo[P]
	%initial innovations for ARMA
	index=M
	loop M 
		eps_m[index]=0
		index=index-1
	end
	%initial return for ARMA
	index=N
	loop N
		R_n[index]=Ro[index]
		index=index-1
	end
	%initial innovations, return for variance
	index=P
	loop P
		eps[index]=0
		R[index]=Ro[index]
		index=index-1
	end	
	%Vr=Vo[P]
 
	fork 
		loop inf
			theta DT_gch
				GRCH_fct=sum(Vt*GRCH,2)
    			        ARCH_fct=sum(eps^2*ARCH,2)
				Vr=max(0,Kappa+GRCH_fct+ARCH_fct);
				Z=sqrt(Vr)*randn()
				R_tmp=C+sum(phi*R_n,2)+sum(tht*eps_m,2)+Z
				S_g=S_g*exp(R_tmp-r*DT_gch)
				%updating the ARMA parameters
				%updating innovations
				index=1
				loop M-1
					eps_m[index]=eps_m[index+1]
					index=index+1
				end
				eps_m[Q]=Z
				%updating return
				index=1
				loop N-1
					R_n[index]=R_n[index+1]
					index=index+1
				end
				R_n[Q]=R_tmp
				%updating the variance parameter	
				%Updating the innovation				
				index=1
				loop Q-1
					eps[index]=eps[index+1]
					index=index+1
				end
				eps[Q]=Z
				%Updating the volatiliy		
				index=1
				loop P-1
					Vt[index]=Vt[index+1]
				end
				Vt[P]=Vr
		end
	end
 
	fork 
		loop inf
			theta $dt
			%Brownian Bridge
			EUR=EUR*exp(-r*$dt)
			lambda=($time/DT_gch-floor($time/DT_gch))/DT_gch
			S=S_g^(1-lambda)*S_g!^(lambda)*exp(sqrt(Vr*lambda*(1-lambda))*randn())
		end
                S_g = S_g
	end
end

[edit] Pricing European Put using the ThetaScript implementation

A European put option can be modelled as follows:

%% The model European_put computes price "P" of 
%% a European put option 
model European_put
	import So    "Initial Stock price"
	import K     "Strike price"
	import EURo  "Initial Numeraire"
	import T     "Time to maturity"
 
	export Vol   "volatility process"
	export ER    "Numeraire"
        export P    "option price"
 
        %Calling GARCHPQ process
        %call filename:modelname
        %The GARCH model is assumend to be implemented in VolaModels.
 
        %GARCH(P,Q) process	
	Ro=[0.2]
	Vo=[0.5^2/250]
	ARCH=[0.079]
	GRCH=[0.91]
	phi=[0]
	tht=[0]
	C=3.9e-4
	Kp=1.69e-6
 
	call VolaModels:GARCHPQ
		export So,EURo,0.05 to r,Ro to Ro,Vo to Vo,phi to phi,tht to tht,C to C,
                ARCH to ARCH,GRCH to GRCH,Kp to kappa,0.1 to DT_gch
		import S,EUR,Vr	
 
        P = V!
 
        Theta T     
 
        V = max(K*EUR-Stock,0)
 
end