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

garchheteroscedasticityrtime series

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:

enter image description here

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)

enter image description here

  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!

Best 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.