Calculates volatility forecasts based on the GJR-GARCH model.

GJR-GARCH extends GARCH with a leverage term that lets negative shocks (bad news) raise volatility by more than positive shocks of the same size, a well documented asymmetry in equity returns that symmetric GARCH cannot capture.

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: GJR-GARCH, threshold GARCH, TGARCH.

GJR-GARCH Volatility Model in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_gjr_garch as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AMZN", "TSLA"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.risk.get_gjr_garch(period="quarterly")

Which returns:

Date AMZN TSLA Benchmark
2024Q2 0.027 0.1542 0.0053
2024Q3 0.0267 0.1513 0.0047
2024Q4 0.0266 0.1642 0.0048
2025Q1 0.0264 0.1937 0.0046
2025Q2 0.027 0.1603 0.0065
2025Q3 0.0267 0.157 0.0053
2025Q4 0.0265 0.173 0.005
2026Q1 0.0264 0.1503 0.0046
2026Q2 0.0267 0.1506 0.0066
2026Q3 0.0265 0.1513 0.0061

Parameters

The function accepts the following parameters:

  • period (str, optional): The data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “quarterly” if the Toolkit is initialized with quarterly=True, otherwise “yearly”.
  • time_steps (int, optional): Time steps to calculate GJR-GARCH for.
  • optimization_t (int, optional): Time steps to optimize GJR-GARCH for. It is only used if no weights are given.
  • within_period (bool, optional): Whether to calculate GJR-GARCH within the specified period or for the entire period. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the GJR-GARCH values over time. Defaults to False.
  • lag (int | list[int], optional): The lag to use for the growth calculation. Defaults to 1.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
Share