Skip to content
All library documents

Comparing GARCH Forecast Volatility with Realized Volatility

Article Quant Q&A · Author: user14298777

Summary

The document presents a question about annualizing volatility from a fitted GARCH(1,1) model for stock returns. The example uses daily percentage returns, fits a normal-error GARCH model with rescaling enabled, forecasts variance several days ahead, reverses the model’s scale adjustment, and converts the forecast standard deviation to an annualized percentage using the assumed number of trading days.

The reported forecasts rise across the horizon but remain below the annualized standard deviation calculated directly from the full return sample. This gap is the problem posed, not a resolved finding: the document supplies no answer explaining whether the difference reflects forecast versus realized volatility, model fit, return scaling, or another implementation detail. The example is limited to one stock and one sample period, and it does not establish that either estimate is generally more appropriate.

Key ideas

  • A GARCH(1,1) model can produce conditional variance forecasts from a return series.
  • Annualized forecast volatility is obtained by taking the square root of forecast variance and applying a trading-day adjustment.
  • When model fitting rescales returns, the forecast must be converted back to the original scale.
  • A model-based forecast can differ from the sample standard deviation of historical returns.
  • The document raises the discrepancy but does not diagnose its cause.

Tags

Full text
# garch(1,1) Annualised Volitility with python


# garch(1,1) Annualised Volitility with python












I am trying to calculate the annualized Volatility of given returns for a stock with Garch(1,1) on python using a code I found online. The value I should be getting is around 27, but the value I am getting is between 17 to 19. I would be really grateful if someone can point out my mistake.

This is the code I am using:

```
start = datetime.datetime(2017, 9, 8)
end = datetime.datetime(2020, 9, 7)

df = web.DataReader("HDFCBANK.NS", 'yahoo', start, end)
df.tail()

data=pd.DataFrame()
data = df['Close']
returns = data.pct_change().dropna()

model_irfm = arch_model(returns, vol='Garch', p=1, o=0, q=1, dist='Normal', rescale=True )
res_irfm = model_irfm.fit()
scale = res_irfm.scale
print(res_irfm.summary())

# Forecast
forecasts_irfm = res_irfm.forecast(horizon=5)

# Getting Annualized Standard Deviation
# Garch Vol
vol_irfm_for = (forecasts_irfm.variance.iloc[-1] / np.power(scale, 2))**0.5 * np.sqrt(252) * 100
print('vol_irfm_for',vol_irfm_for)

# Observed Vol
vol_irfm = returns.std() * np.sqrt(252) * 100
print('vol_irfm',vol_irfm)
```

The result

```
vol_irfm_for h.1    17.866891
h.2    18.212123
h.3    18.539075
h.4    18.849109
h.5    19.143440
Name: 2020-09-07 00:00:00, dtype: float64
vol_irfm 27.00143321696037
```

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.