1
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ I have already answered this fully in the Quantitative Finance (QF) forum of SE. See quant.stackexchange.com/questions/9351/… $\endgroup$ – JoleT Sep 19 '18 at 23:35
  • 1
    $\begingroup$ In your question the author of the question notices the same thing. Why are there so many different formulas? Which one do I choose and why? $\endgroup$ – CL40 Sep 20 '18 at 1:32
  • 1
    $\begingroup$ Additionally, this question is for AR(1)-GARCH(1,1). What is the difference between this and GARCH(1,1)? $\endgroup$ – CL40 Sep 20 '18 at 1:38
  • 1
    $\begingroup$ I guess a third question for you while im asking them - you didn't specify an optimization. I have seen people use "Solver" in excel, which is a linear programming solver. I have also seen gradient descent used. Is there a reason to prefer one over the other for this problem? $\endgroup$ – CL40 Sep 20 '18 at 2:59
  • 1
    $\begingroup$ You would need to look at those original papers to learn about the difference between AR(1)/GARCH(1,1) and GARCH(1,1). Use the formula in the SOLUTION for maximizing the likelihood, if you want to follow the same solution. You have to understand that the "quants" visiting the QF forum, when learning that function maximization is required, would merely, go "okay -- I'll use my favorite maximizer." $\endgroup$ – JoleT Sep 21 '18 at 22:58
2
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.