Specify and taste the GARCH model flavors
In the next chapters, you will see that GARCH models come in many flavors. You thus need to start off by specifying the mean model, the variance model and the error distribution that you want to use. The best model to use is application-specific. A realistic GARCH analysis thus involves specifying, estimating and testing various GARCH models.
In R, this is simple thanks to the rugarch
package of Alexios Ghalanos. This package has already been loaded for you. You will apply it to analyze the daily returns in sp500ret
.
Cet exercice fait partie du cours
GARCH Models in R
Instructions
- Use
ugarchspec()
to specify that you want to estimate a standard GARCH(1,1) model with constant mean and a normal distribution for the prediction errors. - Use
ugarchfit()
to estimate the model by maximum likelihood. - Use the method
sigma()
to retrieve the estimated volatilities. - Plot the volatility predictions for 2017.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Specify a standard GARCH model with constant mean
garchspec <- ___(mean.model = list(armaOrder = ___),
variance.model = list(model = "___"),
distribution.model = "___")
# Estimate the model
garchfit <- ___(data = ___, spec = ___)
# Use the method sigma to retrieve the estimated volatilities
garchvol <- ___
# Plot the volatility for 2017
___(___["2017"])