Skip to content
All library documents

Adding External Regressors to the Mean and Variance of a GARCH Model

Article Quant Q&A · Author: YT Tai

Summary

The discussion explains how to include control variables in both the conditional mean and conditional variance of a GARCH model using the rugarch package in R. The example specifies one external regressor for the mean equation and another for the variance equation, then fits the model to a data series. This provides a practical package-level approach for researchers who want to model returns and time-varying volatility while incorporating explanatory variables.

The reply notes a likely indexing typo in the question’s variance equation: the coefficient on the lagged variance is presumably the second coefficient rather than a repeated third coefficient. The document does not explain estimation assumptions, diagnostics, or how to interpret the regressor effects, and its demonstration uses simulated data only. Users must ensure that their specification and regressor timing suit their application.

Key ideas

  • External regressors can be specified separately in the conditional mean and variance equations of a GARCH model.
  • The rugarch workflow defines a model specification and fits it to a data series.
  • The example uses distinct inputs for mean and variance controls.
  • The variance equation in the question likely contains a repeated coefficient label where a second coefficient was intended.
  • The example does not cover model diagnostics or interpretation of estimated effects.

Tags

Full text
# How to add controls (regressors) to GARCH model in R?


# How to add controls (regressors) to GARCH model in R?












How can I estimate a GARCH(1,1) model with control variables like this: $$Y_t=a_0+a_1X_t+e_t$$ where$$ e_t\sim N(0,h_t)$$ $$h_t=b_0+b_1e_{t-1}^2+b_3h_{t-1}+b_3Z_t$$ I've checked some packages but can't fix it. Hope you guys can shed some lights!

## Answer by Richard Hardy (score 2, accepted)

https://quant.stackexchange.com/a/37067

Here is how you do that in R with library "rugarch":

```
library(rugarch)
#n=1e3; set.seed(1); x=rnorm(n); set.seed(2); y=rnorm(n); set.seed(3); z=rnorm(n)
spec = ugarchspec(variance.model = list(external.regressors = cbind(z)), mean.model = list(armaOrder = c(0, 0), external.regressors = cbind(x)))
fit = ugarchfit(spec = spec, data = y)
```

The object `fit` contains the fitted model. If you uncomment the second line, you can try it out with randomly generated data.

(I suppose you meant $b_2$ -- not $b_3$ -- before $h_{t-1}$.)

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.