GARCH Volatility Forecast
Calculates sigma_2 forecasts.
GARCH (Generalized autoregressive conditional heteroskedasticity) is stochastic model for time series, which is for instance used to model volatility clusters, stock return and inflation. It is a generalisation of the ARCH models.
The formula is as follows:
\[\sigma_{n + h} ^{2} = \sigma_{L} ^{2} + (\sigma_{n + 1} ^{2} - \sigma_{L} ^{2}) \cdot (\text{Alpha} + \text{Beta}) ^{h - 1}\] \[\sigma_{L} ^{2} = \text{Omega} / (1 - \text{Alpha} - \text{Beta})\]Where n is the last observation, h = 1, …, time_steps (10 by default) the forecast step, sigma_(n+1)^2 the one-step-ahead variance of the fitted GARCH(1, 1) recursion (see get_garch) and sigma_L^2 the long-run variance.
For more information about the method, see the following book:
- Finance Compact Plus Band 1, by Yvonne Seler Zimmerman and Heinz Zimmerman; ISBN: 978-3-907291-31-1
Also known as: volatility forecast, predicted volatility.
GARCH Volatility Forecast in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_garch_forecast as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["^GSPC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_garch_forecast()
Or, after setting up the Finance Toolkit MCP, ask:
What variance does a GARCH(1,1) model of the S&P 500, fitted on its returns from 2021 to 2025, forecast for the first ten trading days of 2026?
Which returns:
| ^GSPC | Benchmark | |
|---|---|---|
| 2026-01-01 | 0.0001 | 0 |
| 2026-01-02 | 0.0001 | 0.0001 |
| 2026-01-05 | 0.0001 | 0.0001 |
| 2026-01-06 | 0.0001 | 0.0001 |
| 2026-01-07 | 0.0001 | 0.0001 |
| 2026-01-08 | 0.0001 | 0.0001 |
| 2026-01-09 | 0.0001 | 0.0001 |
| 2026-01-12 | 0.0001 | 0.0001 |
| 2026-01-13 | 0.0001 | 0.0001 |
| 2026-01-14 | 0.0001 | 0.0001 |
Parameters
get_garch_forecast accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”. | "weekly" |
time_steps | int | Time steps to calculate GARCH and to forecast sigma_2 values for. Defaults to 10. | 20 |
within_period | bool | Whether to calculate GARCH within each specified period or all at once. Thus whether to look at the GARCH within each specific year (if period = ‘yearly’) or look at the entirety of all years. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
growth | bool | Whether to calculate the growth of the GARCH values over time. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |