I want to wrap up my own GARCH implementation

  • to make sure I have understood the underlying model/assumption.
  • to leverage forecast::auto.arima to automate model order selection (see below).
  • to mitigate the potential issues with parameters, so that I don't have to switch to IGARCH when the sum of parameters are close to 1, etc.


Suppose $a_t$ is a residual term with zero mean and zero conditional mean, the GARCH(p, q) model is given by

$$ \begin{equation} \left\{ \begin{aligned} a_t &= \sigma_t \epsilon_t \\ \sigma_t^2 &= \alpha_0 + \sum_{i=1}^p \alpha_i a_{t-i}^2 + \sum_{j=1}^q \beta_j \sigma_{t-j}^2 \end{aligned} \right. \end{equation} $$

Where $\epsilon_t \stackrel{iid}{\sim} \text{WN}(0, 1)$. If we let $\eta_t^2 := a_t^2 - \sigma_t^2$, then an alternative representation is

$$ \begin{equation} \left\{ \begin{aligned} a_t &= \sigma_t \epsilon_t \\ a_t^2 &= \alpha_0 + \sum_{i=1}^{\max(p, q)} (\alpha_i + \beta_i)a_{t-i}^2 + \eta_t - \sum_{j=1}^q \beta_j \eta_{t-j} \end{aligned} \right. \end{equation} $$

According to my professor, $\eta_t$ can be proved to have zero mean, and are uncorrelated (but not independent).


From above we can see that the squared residual $a_t^2$ is an ARMA process, so as stated before, I'll just fit an ARMA on $a_t^2$. As far as I know, we don't have xxx::auto.garch but there is forecast::auto.arima, which would help us to find the correct order of ARMA.

This lets us model/forecast the conditional mean of squared residuals. However, what we really care about is the conditional volatility of $a_t$, but I'm lost here.

$$ \begin{equation} \begin{aligned} E(a_t^2 | I_{t-1}) &= \text{var}(a_t | I_{t-1}) \\ &= \text{var}(\sigma_t \epsilon_t | I_{t-1}) \\ &= \text{var}(\sigma_t | I_{t-1}) \text{var}(\epsilon_t | I_{t-1}) + \text{var}(\sigma_t | I_{t-1}) E^2(\epsilon_t | I_{t-1}) + \text{var}(\epsilon_t | I_{t-1}) E^2(\sigma_t | I_{t-1}) \\ &= \text{var}(\sigma_t | I_{t-1}) + E^2(\sigma_t | I_{t-1}) \\ &= \text{???} \end{aligned} \end{equation} $$


How do I get "conditional volatility of residuals" from "conditional mean of squared residuals"?

  • $\begingroup$ Very interesting question! I had been wondering for a while whether auto.arima could be used for GARCH model selection much along the same lines as you did, but never had the time to work on that. If the solution is free from fatal conceptual mistakes, you could probably release a version of auto.garch for R users, it might become popular :) $\endgroup$ Jun 13, 2019 at 17:28
  • $\begingroup$ @RichardHardy I love this idea. Will attempt it! $\endgroup$
    – nalzok
    Jun 13, 2019 at 17:30

2 Answers 2


I just add this piece to the reasoning to complement what you have said and asked, as it seems that your initial objective is to use the ARMA autofit to implement a GARCH autofit. In order to do this, you need to model the process for squared returns, which is not easy due to the fact that the distribution of the squared returns depends on the true distribution of returns. If you assume that the latter is normal, as it usual under normal QMLE, the the distribution of the squared returns is parametric as highlighted later. Now let’s highlight an additional source of complexity: an additional reason why it is not easy to implement a GARCH autofit, and is not correct to use the ARMA autofit, is that the innovations in squared returns cannot be assumed to be iid, as they are not independent. Therefore it is not theoretically possible to transform the specification of a GARCH into the specification of an ARMA on squared returns due to the latter problem. Anyway, if you wish to do so by forcing an iid assumptions on the innovations of squared return to simplify the derivation of the likelihood function, then consider that you need the conditional variance of squared returns. So read the following.

If you assume returns to be conditionally normal, then the conditional variance of squared returns is the variance of a squared normal distribution (as, if returns are conditionally normally distributed, here you are interested in the second central moment of the conditional distribution of their square). The formula for the calculation of the conditional variance of a squared normal with a given variance (which in your case is the given GARCH conditional variance, or the expected value of your squared ret) is given here along with more complete info on the shape of the conditional distribution of the squared returns. You will need to assume that the fourth central moment of return distribution exists finite, which is ok.

Now you have the conditional mean of squared returns, which is the GARCH conditional variance, the conditional variance of squared returns, and the pdf (from the link provided). Now you can write the likelihood for an ARMA on squared returns. But you can do iff you force the assumptions that the innovations for squared returns are iid. Which we cannot say it is right. So pay attention to the problem that your QMLE estimator may have.

  • $\begingroup$ I think $\text{WN}(0,1)$ means white noise which is not necessarily $N(0,1)$. In finance, standardized innovations are often better described by distributions other than normal, e.g. Student-$t$. Even if standardized innnovations could be assumed to be normally distributed without too much trouble, one would not assume returns themselves to be conditionally normally distributed as they have considerably heavier tails. In any case, I am now wondering what is your concrete answer (complete the formula) and whether it is different from mine. If so, why the difference and what to do about it? $\endgroup$ Aug 31, 2019 at 8:01
  • $\begingroup$ Hi Richard, I will be with you in a few hours! Thanks for the reminder. Essentially I anticipate you are right, indeed, I did not want to overcome your solution, just to integrate what already said highlighting that for a full-scale auto.spec you have to take into account the assumed conditional distribution of the squared returns, which may be not very simple in some cases $\endgroup$
    – Fr1
    Sep 4, 2019 at 19:39
  • $\begingroup$ " I think WN(0,1) means white noise which is not necessarily N(0,1). In finance, standardized innovations are often better described by distributions other than normal, e.g. Student-t " yes, of course not even a Student-t: student t gives a better proxy with fat tails, but it is not even the correct solution for a good fit to most daily or intraday returns).. $\endgroup$
    – Fr1
    Sep 8, 2019 at 19:10
  • $\begingroup$ I just exemplified with the normal, after a very quick look at the question (however you are right he just wrote WN, not NWN or N!). The point here is that when you want to work with an auto.fit you want to check what likelihood is the highest depending on the value of the parameters of your different models, which means that you have to work on the likelihood, which means that you have to assume a distribution for the innovations of squared returns (which moreover cannot be assumed to be fully iid!). $\endgroup$
    – Fr1
    Sep 8, 2019 at 19:10
  • $\begingroup$ Even assuming they are iid, you have to take a parametric distribution, which as I tried to underline, depends on the assumed distribution of the return innovations. So as you see it is difficult to draw an autofit on a garch and ausing the auto.arma is not a trivial solution. This is to be underlined on my side. A solution is to say "Ok, I will use QMLE so that i can ignore the true distribution of innovations for the squared returns, at the cost of a decreased efficiency of the estimator), and assume another convenient distribution (exactly like you can use normal QMLE on ... $\endgroup$
    – Fr1
    Sep 8, 2019 at 19:14

Given that $\sigma_t^2$ is part of $I_{t-1}$ because of $$ \sigma_t^2 = \alpha_0 + \sum_{i=1}^p \alpha_i a_{t-i}^2 + \sum_{j=1}^q \beta_j \sigma^2_{t-j} $$ and given $$ \epsilon_t \stackrel{iid}{\sim} \text{WN}(0, 1), $$ couldn't you do $$ \begin{equation} \begin{aligned} E(a_t^2 | I_{t-1}) &= \text{var}(a_t | I_{t-1}) \\ &= \text{var}(\sigma_t \epsilon_t | I_{t-1}) \\ &= \sigma_t^2 \text{var}(\epsilon_t | I_{t-1}) \\ &= \sigma_t^2 \cdot 1 \\ &=\alpha_0 + \sum_{i=1}^p \alpha_i a_{t-i}^2 + \sum_{j=1}^q \beta_j \sigma^2_{t-j} \end{aligned} \end{equation} $$ ?

  • $\begingroup$ BTW, is "conditional volatility of residuals" just "conditional mean of squared residuals"? We have $E(a_t^2 | I_{t-1}) = \text{var}(a_t | I_{t-1})$, but your answer to my previous question suggests there are some subtle differences. $\endgroup$
    – nalzok
    Jun 14, 2019 at 3:33
  • $\begingroup$ @nalzok, if residuals $a_t$ are guaranteed to have a conditional mean of zero, then by definition of the conditional variance $\text{Var}(a_t|I_{t-1})=\mathbb{E}(a_t^2|I_{t-1})-(\mathbb{E}(a_t|I_{t-1}))^2=\mathbb{E}(a_t^2|I_{t-1})-0^2=\mathbb{E}(a_t^2|I_{t-1})$. $\endgroup$ Jun 14, 2019 at 5:42
  • $\begingroup$ I see, but I still can't wrap my head around it. What are we interested in when using GARCH, $\text{var}(a_t|I_{t-1})$ or $E(\sigma_t^2|I_{t-1})$? In your previous answer, you referred to $\sigma_t^2$ as "the conditional variance", but a random variable can't be conditional by itself, so I'm kinda confused. $\endgroup$
    – nalzok
    Jun 14, 2019 at 6:57
  • $\begingroup$ @nalzok, not sure exactly what question we have here, but I will try. Since $\sigma^2_t|I_{t-1}$ is a constant (not a random variable), $\mathbb{E}(\sigma^2_t|I_{t-1})=\sigma^2_t=\alpha_0 + \sum_{i=1}^p \alpha_i a_{t-i}^2 + \sum_{j=1}^q \beta_j \sigma^2_{t-j}$. The random variable of interest is $a_t$ the conditional variance of which is $\sigma^2_t$. According to GARCH, the moments of $a_t$ are determined by the past values of $a_t$, so the random variable is producing the parameters of its own future. This is common to all autoregressive models. $\endgroup$ Jun 14, 2019 at 8:15
  • $\begingroup$ Your explanation is quite clear, thanks! $\endgroup$
    – nalzok
    Jun 14, 2019 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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