# Deciding if the (G)ARCH model is adequate, and how to fix heteroskedasticity

I'm just curious how I would use residual plots to check if the (G)ARCH model is adequate. After estimating the ARIMA, I found that there was still heteroskedasticity in the residuals, so I estimated a GARCH. The code is below:

garch.spec =  ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(5,5)),
mean.model = list(armaOrder = c(2,2), include.mean = TRUE,external.regressors = fourier(y, K=11)))
fit11    = ugarchfit(garch.spec,data = ts(solar,start=1,end=14,f=48), solver = "nloptr")

Plotting the residuals:

Whereas the ACF and PACF look alright (to me), the residuals are clearly not homoscedastic, but even upon changing my garchOrder=c(a,b), it doesn't change much.

Any help would be much appreciated!

# Edit

Hi, great answers, but now I've some additional questions!

1. You mentioned “standardised residuals”, I am curious if I am testing for “standardised residuals”, and if not, how do I test for them? This is the code for the ARIMA, I decided upon the order based on the ACF and PACF. Moreover, because there was heteroskedasticity in the residuals of the ARIMA(2,0,2), I then decided to try a (G)ARCH.

n = 672 y = ts(solar,start=1,end=14,f=48) fit=Arima(y, order=c(2,0,2), xreg=fourier(y, K=11)) usolar=residuals(fit) dev.new() plot(usolar) dev.new() acf2(usolar) dev.new() plot(y-usolar,usolar)

2. From what I understand the Q-Q plot is used to assess if something came from some sort of distribution, however if I have 672 observations would I still use a Q-Q plot?

3. You mention statistical tests to check properties, what type of test(s) are recommended?

This is the code for the (G)ARCH, note please that it has been changed from GARCH(5,5) to GARCH(2,2). ACF and PACF of GARCH(2,2) are attached.

n=672
garch.spec =  ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(2,2)),
mean.model = list(armaOrder = c(2,2), include.mean = TRUE,external.regressors = fourier(y, K=11)))
fit11    = ugarchfit(garch.spec,data = ts(solar,start=1,end=14,f=48), solver = "nloptr")
uusolar=residuals(fit11)
dev.new()
plot(uusolar)
dev.new()
acf2(uusolar)

1. Regarding Fourier series, I’ve added it as an external regressor as part of the mean model. Is it wise to add it again to the variance model?
2. My interest is in making forecasts, and then comparing those to my actual values, how important is heteroskedasticity in this regard for my dataset specifically (if you can tell, I don’t know if you can)?
3. Is my procedure sensible/correct?

Cheers in advance!

• I presume you are using standardized residuals, because unstandardized residuals (raw residuals from the ARIMA model) are not supposed to be well behaved. By the way, your GARCH(5,5) model is probably too complex; GARCH(1,1) or at most (2,2) is what is typically used in the literature. – Richard Hardy Nov 12 '16 at 13:58
• Sorry Richard, to clarify what does "too complex" mean/what are the implications? – Bordiger Nov 17 '16 at 23:46
• "Too complex" as having too many parameters. When a model is too complex, it fits nicely in sample but generalizes poorly out of sample, i.e. does a poor job approximating what is happening in the population. – Richard Hardy Nov 18 '16 at 5:57
• Ah ok, how do we decide if a model's "too complex"? – Bordiger Nov 18 '16 at 6:53
• There is no universal method, but you may check various diagnostics. E.g. if a simpler model has a lower AIC or BIC value, it might signal that the original model is too complex. Also, I already mentioned that GARCH(5,5) is hardly ever used in practice and GARCH(1,1) or at most (2,2) should be sufficient in most applications. – Richard Hardy Nov 18 '16 at 8:09

## 1 Answer

I'm just curious how I would use residual plots to check if the (G)ARCH model is adequate.

You may wish to assess two properties of the standardized residuals:

1. Whether they come from the distribution that was assumed (a distribution must have been assumed so as to construct the likelihood of the model that was maximized).
2. Whether they have no autocorrelation and no autoregressive conditional heteroskedasticity.

You may use statistical tests to check these properties, but you may also try to infer something from residual plots.

1. You may use a Q-Q plot to see how far away the empirical quantiles are from the theoretical quantiles (the further, the worse).
2. You may use ACF and PACF plots for raw standardized residuals and squared standardized residuals to assess autocorrelation and ARCH, respectively. Note that the standard critical values in ACF and PACF plots will not be the relevant ones because the residuals are not raw data, but even the standard critical values may give you some intuition.

You may also look at the simple plot of standardized residuals, as you have already done. They should look more or less like white noise, and you note correctly that this is not quite the case, so the current model might not be entirely appropriate. However, it is difficult to tell whether it would be easy to construct a better model and get better-behaved residuals, though.

and how to fix heteroskedasticity

Perhaps you could add some seasonal terms (dummies or Fourier series) in either the conditional mean or the conditional variance model, as the heteroskedasticity appears to be seasonal (judging from the first graph).

Edit:

After the edit of the OP, here are answers to the extra questions:

1. The notion of standardized residuals is relevant for GARCH, but not ARMA models. Standardized residuals in the GARCH model are the sample counterparts of $\varepsilon$ where \begin{aligned} y_t &= \mu_t + u_t, \\ u_t &= \sigma_t \varepsilon_t, \\ \sigma_t^2 &= \omega + \alpha_1 u_{t-1}^2 + \beta_1 \sigma_{t-1}^2, \\ \varepsilon_t &\sim i.i.d.(0,1). \end{aligned} Here the fitted $\hat u_t$ is the raw residual while $\hat \varepsilon_t$ is the standardized residual.
How do you obtain $\hat \varepsilon_t$? Use method residuals with the option standardize=TRUE; from the documentation of the "rugarch" package regarding the method residuals applied to class uGARCHfit:

residuals signature(object = "uGARCHfit"): Extracts the residuals. Optional logical argument standardize (default is FALSE) allows to extract the standardized residuals.

2. Why not?

3. For autocorrelation you may try the Breusch-Godfrey or Ljung-Box tests, but I am not entirely sure what the null distributions should be when the data is the standardized residuals from an ARMA-GARCH model. Practitioners often neglect this issue, but that does not necessarily mean they are doing things properly.
For ARCH patterns you may use the Li-Mak test (but not the ARCH-LM test, again because you are applying it on standardized residuals rather than raw data).
4. Depending on the data, it is possible that there is seasonality both in the conditional mean and the conditional variance, so you may try including Fourier terms in both models.
5. It is a quantitative rather than qualitative question, and it will depend on the data at hand. If the heteroskedasticity is pronounced, it makes sense to account for it. But a GARCH model need not be a good model for a particular data set, so using it is not guaranteed to help. As you see, this is a very empirical question; you will have to try and see what works and what does not.
6. Based on the discussion we are having, it looks as if you are on the right track.
• Cheers Richard, because it wont let me post more stuff, I made a new thread (I'm hoping for some more clarity, but not because your explanation wasn't good, more because I'm still not very good at this whole statistics thing). stats.stackexchange.com/questions/245563/… – Bordiger Nov 12 '16 at 15:47
• @Bordiger, It's probably better to keep it inside this thread as this is all about the same thing. You should be able to edit your own post. Just add a section at the end starting with Edit:. Or if you cannot find a way, I can do it for you. I would copy the content of the new thread and paste here, and you would delete the new thread. – Richard Hardy Nov 12 '16 at 16:35
• Oh, ok, I'll try to work it out – Bordiger Nov 12 '16 at 22:40
• Hi Richard, as per your advice, I've edited the above and deleted the other thread – Bordiger Nov 12 '16 at 22:57
• @Bordiger, I have extended my answer to cover your new questions. How is it now? – Richard Hardy Nov 14 '16 at 8:42