1. The rugarch package
The parameters alpha and beta drive the volatility series denoted by sigma. In this video you will learn to use the package rugarch to estimate them.
2. The normal GARCH(1,1) model with constant mean
You need to first specify the GARCH model you want to estimate. For simplicity, You need to first specify the GARCH model that you want to estimate. For simplicity, we assume here that the return is normally distributed with constant mean mu and time-varying variance sigma_t squared. The variance follows the GARCH equation.
You then have four parameters to estimate: the mean parameter mu, and the GARCH variance parameters omega, alpha and beta. You can estimate those parameters by maximum likelihood. This means finding the parameter values such that the estimated GARCH model is most likely to have generated the observed return series.
3. Alexios Ghalanos
Maximum likelihood estimation of GARCH models is straightforward when you use the R package rugarch of Alexios Ghalanos.
4. Workflow
It requires to first use the ugarchspec function to specify the GARCH model assumptions for the mean, the variance and the distribution.
Then you use the function ugarchfit to estimate the model.
Finally, to make predictions about future returns, you need to use the function ugarchforecast.
5. Workflow in R
Here you see the corresponding R code.
First the arguments mean.model, variance.model and distribution.model are set in ugarchspec . For mean.model we specify that the mean is constant. We don't use an arma model and thus set the armaOrder equal to the vector 0,0. For the variance we take the standard GARCH model. As distribution.model we specify here to use the normal distribution.
Then we estimate the model by applying the ugarchfit function with as arguments the returns used to estimate and the GARCH specification.
In ugarchforecast we use the estimated garch model and set the argument n.ahead to specify for how many days ahead we make the prediction.
6. ugarchfit object
The results of the GARCH estimation are available in the ugarchfit object.
You can use the methods coef, uncvariance, fitted and sigma to extract useful information regarding the GARCH coefficient estimates, the unconditional variance, the predicted mean and volatility.
7. GARCH coefficients for daily S&P 500 returns
You see here the estimation output for the daily S&P 500 returns. The estimated alpha and beta are 0-point-08 and 0-point-91. Since their sum is less than one, the estimated volatility is mean reverting with long run value equal to the square root of its unconditional variance.
For the daily S&P 500 returns, you can see that the long run standard deviation equals 1%.
8. Estimated volatilities
You obtain the time series of estimated volatilities by applying the sigma method to the rugarchfit object.
The volatility is clearly mean reverting around a long run value of 1%.
9. What about future volatility?
Note that the last value is 0-point-48% which is only half of the long term value of 1%. You can thus expect the future volatility to gradually increase over the next days.
10. Forecasting h-day ahead volatilities
This is indeed the case, as you can see by applying the sigma method to the output from the ugarchforecast function.
The volatility steadily increases from 0-point-50% to 0-point-54% over the next five days.
11. Forecasting h-day ahead volatilities
Applying the fitted method gives the predicted mean. This prediction is constant here since the mean.model assumes a constant mean.
12. Application to tactical asset allocation
At the end of the chapter, you will use the GARCH model to solve the tactical allocation problem of deciding how to split your wealth between an investment in a risky asset and an investment in a risk free asset.
A popular approach called volatility targeting solves this problem by setting the weight such that the portfolio volatility equals a constant target level, like 5%.
Under this approach, the optimal weight equals 5% times the inverse of the GARCH volatility.
13. Let's play with rugarch!
Let's do some exercises and play with the rugarch package.