I have been working on manually implementing an ARMA GARCH (1,1) model but have been running into a few issues, namely a very large forecasted variance. I am hoping by outlining my process someone can catch a mistake.

First for ARMA, $$X_t = c + \phi X_{t-1} + \theta \epsilon_{t-1} + \epsilon_t$$ I assume some $c, \phi$, and $\theta$ and that $\epsilon_0 = 0$. Then by writing the above as $$\epsilon_t = X_t - c - \phi X_{t-1} -\theta\epsilon_{t-1}$$ I marched forward to construct a vector of $\epsilon_i$. The above process is optimized using OLS to return the set of $c, \phi$ and $\theta$, such that the vector of $\epsilon_i$ is minimized. I then use the optimized set of parameters to construct a forecast so that I can obtain a vector of ARMA residuals. Using my code, this is what an example output looks like:

ARMA residuals

Do these residuals seem reasonable? Is my assumption that $\epsilon_0 = 0$ fair, or should it be excluded afterwards? Also, I currently have no constraints on my ARMA parameters, some sources claim that $|\phi| \leq 1$ should be imposed. Will this make a difference?

I then feed these residuals into a GARCH model, $$\sigma_{t}^2 = \omega + \alpha\epsilon_{t-1}^2 + \beta\sigma_{t-1}^2\\\epsilon_i = \sigma_i p_i $$ where $p_i$ is a process associated with some (not necessarily Gaussian) distribution with mean 0 and scale 1.

To calculate the GARCH parameters I use MLE. I assume $\sigma^2_0 = 0$. For each time $n \in [0, t]$ I march forward using the GARCH equation and the ARMA residuals until I reach $\sigma_n^2$. I then evaluate $\frac{\epsilon_n}{\sigma_n}$ at the distribution's log PDF to obtain a probability. The sum of these values from $T=1$ to $T = t$ is my overall MLE. I also assume some parameters for the distribution (if there are any beyond the mean and scale). I then repeat this process so that I optimize both my distribution parameters and also my GARCH parameters. I require that all GARCH parameters be non-negative and that $\alpha + \beta = 1$

As noted, this process leads to incredibly large values for the forecasted variances (around 4000-5000). I notice it also chooses a rather large value for $\omega$ (somewhere around 8-30), and almost always chooses $\alpha = 0, \beta = 1$. For what it is worth, I am using the NLOPT package for the optimization and the COBYLA algorithm.

Does anyone see where I might have made a mistake or if I have made a false assumption? Thanks for reading!

  • 1
    $\begingroup$ (Perhaps) a minor quibble: distribution with mean 0 and scale 1: scale 1 should be variance 1, as scale is not always equal to variance. Another one which I already mentioned under another question of yours: $\sigma_0^2$ is an unusual assumption, especially given it is impossible. The common thing to do is to set $\sigma_0^2=\hat{\sigma}^2$. I would also temporarily drop the ARMA part and experiment with pure GARCH to see what is wrong with it. $\endgroup$ Apr 29, 2021 at 18:21
  • $\begingroup$ @RichardHardy Thank you. I mentioned scale because some distributions I am working with (i.e. NIG) have a scale parameter. In my code I have set the scale equal to 1, perhaps this could be a source of error? In regards to $\hat{\sigma}^2$, how is that calculated? $\endgroup$
    – CBBAM
    Apr 29, 2021 at 18:24
  • $\begingroup$ Indeed, be careful with equating scale with variance. I am not sure about NIG, but I would surely double check if I were you. (It would be funny and cool if that solved the problem!) $\hat\sigma^2$ a naive estimate of the unconditional variance, i.e. the sample variance. $\endgroup$ Apr 29, 2021 at 18:26
  • $\begingroup$ @RichardHardy Thank you. I will make these changes and hopefully that solves the issue. In regards to the ARMA portion, does everything look reasonable? $\endgroup$
    – CBBAM
    Apr 29, 2021 at 18:50
  • $\begingroup$ @RichardHardy Update: I seem to be getting more reasonable forecasts due to the PDF change, but my GARCH terms seem more or less the same even with the updated $\sigma_0^2$. $\endgroup$
    – CBBAM
    Apr 29, 2021 at 18:53

1 Answer 1


Regarding distribution with mean 0 and scale 1: scale 1 should be variance 1, as scale need not be equal to variance for distributions other than Normal.

Also, $\sigma_0^2=0$ is an unusual assumption, especially given that zero variance is impossible. The common thing to do is to set $\sigma_0^2:=\hat\sigma^2$ where $\hat\sigma^2$ is the sample variance.

I would also temporarily drop the ARMA part and experiment with pure GARCH to see what is wrong with it.

  • $\begingroup$ It turns out both the mean and variance of the NIG distribution are functions of other parameters, so I have changed that in my code. I have also set $\sigma_0^2:=\hat\sigma^2$ as my initial variance. However not much has changed in that I am still getting unreasonable forecast values and rather large variances. I compared my ARMA results with an existing package and visually there is not that much of a difference, so I assume the problem is in either GARCH or the distribution optimization, but I cannot tell which. $\endgroup$
    – CBBAM
    Apr 29, 2021 at 19:57
  • $\begingroup$ @CBBAM I suggest that you first try to fit a pure GARCH-model and then extend your results to the ARMA-GARCH case. Also, why do you set the constrain $\alpha+\beta=1$ ? In this case you have an IGARCH(1,1)-model, i.e. the unconditional variance does not exist. $\endgroup$
    – Lars
    Apr 30, 2021 at 9:32
  • $\begingroup$ @Jonas_Dim, check the last comment under the main post. $\endgroup$ Apr 30, 2021 at 9:39

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.