Skip to content
All library documents

Estimating Stock Volatility with GARCH Models in Stata

Article Quant Q&A · Author: Ryan

Summary

The question concerns fitting a GARCH model to daily log returns to estimate stock market volatility. One answer points users to Stata’s built-in GARCH command and its help documentation, but does not provide a detailed step-by-step procedure or discuss model specification.

Another answer describes a manual approach: define a function that simulates a GARCH process for candidate parameters, then use an optimizer to fit the parameters to observed returns. It emphasizes that the result is a time series of conditional volatility estimates rather than one standalone volatility value. This outline is incomplete and does not specify a likelihood function, innovation distribution, diagnostics, or validation method; it also cautions that GARCH is only one modeling choice and that other variants may be appropriate.

Key ideas

  • GARCH can model time-varying volatility in a daily return series.
  • Stata provides a GARCH command that users can investigate through its help system.
  • A manual fitting approach estimates parameters by optimizing model fit to observed returns.
  • The model produces a conditional volatility series rather than a single volatility estimate.
  • GARCH results depend on model choice and should not be treated as definitive.

Tags

Full text
# Garch modelling on Stata


# Garch modelling on Stata












I would like to ask "how to do GARCH modelling on stata".

Basically I want to estimate stock market volatility using daily data. I have one variable as return series, $r_t=\ln(\frac{P_t}{P_{t-1}})$.

I need a step by step explanation.

## Answer by Richard Herron (score 5)

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

I don't use Stata often, but the `help()` function is typically very good. Try `help(garch)`. It looks like the command is

`garch _depvar_ _indepvars_ _options_`

Here's the help page on the web.

## Answer by SRKX (score 4)

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

You need to find the values of the GARCH parameters which fit best your data.

To do so, you usually create a function simulating a GARCH simulation taking, as input the parameters, and you run it through an optimizer to that the sum of the squares of the differences of the simulations points and the sample points are minimal.

Note that it will not give you a number (the volatility, which is not very useful), it will give you a time series of the volatility for each data point.

Finally, beware that this is just a model, it is not the ultimate answer. Try looking at different GARCH versions on the wiki page if you need to.

Note: This is the manual way of doing it. You have packages available in R and MATLAB who handle all that for you, it might exist in Stata.

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.