GARCH – Fitting a GARCH(1, 1) Model: A Comprehensive Guide

garchmaximum likelihood

I am trying to fit my own GARCH(1,1) model using python. I have read numerous papers at this point looking for the log likelihood function of the parameters that I need to optimize. To further confuse matters, each different thing I read comes up with a slightly different variation.

This paper discusses a little bit on the nature of the parameters. Namely, they are normally distributed.

The most clear explanation of this fit comes from Volatility Trading by Euan Sinclair. Given the equation for a GARCH(1,1) model:

$\sigma_t^2 = \omega + \alpha r_{t-1}^2 + \beta\sigma_{t-1}^2$

Where $r_t$ is the t-th log return and $\sigma_t$ is the t-th volatility estimate in the past. Given this, the author hand-waves the log-likelihood function:

$\sum \limits_{i=1}^t [-ln(\sigma_t^2) – \frac{r_t^2}{2\sigma^2_i}]$

However, unfortunately he doesnt indicate how this needs to be used, nor how it is derived. I understand using MLE $\gamma, \alpha, \beta$ need to be deduced. Somehow I will need to use the derivatives of this function to get the results.

Is there an explanation that can lead me to being able to implement this myself? Everything I've seen so far falls woefully short of explaining the entire process, and every paper and book I read derives a different LL equation.

Best Answer

I explain how to get the log-likelihood function for the GARCH(1,1) model in the answer to this question.

The GARCH model is specified in a particular way, but notation may differ between papers and applications. The log-likelihood may differ due to constants being omitted (they are irrelevant when maximizing).

The MLE is typically found using a numerical optimization routine.

A quick implementation example in python:

  1. define relevant packages:

enter image description here

  1. define algorithm

enter image description here

  1. check if output is reasonable

enter image description here