Calculates sigma_2 forecasts based on the GJR-GARCH model.

The formula is as follows:

\[\sigma_{n + h} ^{2} = \sigma_{L} ^{2} + (\sigma_{n + 1} ^{2} - \sigma_{L} ^{2}) \cdot (\text{Alpha} + \text{Gamma} / 2 + \text{Beta}) ^{h - 1}\] \[\sigma_{L} ^{2} = \text{Omega} / (1 - \text{Alpha} - \text{Gamma} / 2 - \text{Beta})\]

Where n is the last observation, h = 1, …, time_steps (10 by default) the forecast step and sigma_(n+1)^2 the one-step-ahead variance of the fitted GJR-GARCH(1, 1, 1) recursion (see get_gjr_garch). The leverage term enters at its expectation, Gamma / 2, as a negative shock is as likely as a positive one.

For more information about the method, see the following paper:

  • Glosten, L.R., Jagannathan, R., and Runkle, D.E. (1993). “On the Relation between the Expected Value and the Volatility of the Nominal Excess Return on Stocks.” The Journal of Finance, 48(5), 1779-1801.

Also known as: volatility forecast, predicted volatility.

GJR-GARCH Volatility Forecast in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_gjr_garch_forecast as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["CLUSD"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.risk.get_gjr_garch_forecast()

Or, after setting up the Finance Toolkit MCP, ask:

What variance does a GJR-GARCH model of crude oil, fitted on its returns from 2021 to 2025, forecast for the first ten trading days of 2026?

Which returns:

  CLUSD Benchmark
2026-01-01 0.0003 0
2026-01-02 0.0003 0
2026-01-05 0.0003 0.0001
2026-01-06 0.0003 0.0001
2026-01-07 0.0003 0.0001
2026-01-08 0.0003 0.0001
2026-01-09 0.0003 0.0001
2026-01-12 0.0003 0.0001
2026-01-13 0.0003 0.0001
2026-01-14 0.0004 0.0001

Parameters

get_gjr_garch_forecast accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”."weekly"
time_stepsintTime steps to calculate GJR-GARCH and to forecast sigma_2 values for. Defaults to 10.20
within_periodboolWhether to calculate GJR-GARCH within each specified period or all at once. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
growthboolWhether to calculate the growth of the GJR-GARCH values over time. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share