Beta Fragility
Calculate the beta fragility heuristic of an investment portfolio or asset, the stress-testing measure of Taleb, Canetti, Kinda, Loukoianova and Schmieder (2012): whether its response to the benchmark bends at the extremes, so that a linear Beta understates its losses in a large market fall.
The formula is as follows:
\[H = (w_{low} \cdot \text{Return\_low} + w_{\text{high}} \cdot \text{Return\_high}) - \text{Return\_middle}\] \[w_{low} = \frac{\text{Benchmark\_high} - \text{Benchmark\_middle}}{\text{Benchmark\_high} - \text{Benchmark\_low}}\] \[w_{\text{high}} = \frac{\text{Benchmark\_middle} - \text{Benchmark\_low}}{\text{Benchmark\_high} - \text{Benchmark\_low}}\]Where the daily returns within each period are sorted by the benchmark return, and low, middle and high are the days with the lowest, the median (position n // 2) and the highest benchmark return. H compares the asset’s return on the median day with the straight line through its returns on the two extreme days. A negative H means the returns are concave in the market’s (fragile: the losses accelerate in a large fall), a positive H that they are convex (antifragile).
Also known as: fragility heuristic, beta fragility heuristic.
Example · JPM, KO, NVDA · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_beta_fragility:
from financetoolkit import Toolkit
toolkit = Toolkit(
["JPM", "KO", "NVDA"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.performance.get_beta_fragility()
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
How fragile was the beta of JPMorgan Chase, Coca-Cola and Nvidia, the change in beta when the market moves, in each year from 2021 to 2025?
Which returns:
| Date | JPM | KO | NVDA |
|---|---|---|---|
| 2021 | -0.0132 | 0.0046 | -0.0026 |
| 2022 | -0.0190 | 0.0000 | 0.0181 |
| 2023 | -0.0052 | 0.0082 | -0.0110 |
| 2024 | 0.0417 | -0.0025 | -0.0068 |
| 2025 | -0.0313 | -0.0263 | 0.0330 |
5 rows
Parameters
get_beta_fragility accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to use for the calculation. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”. | "weekly" |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the ratios. 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 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper Taleb, N.N., Canetti, E., Kinda, T., Loukoianova, E., & Schmieder, C. (2012). “A New Heuristic Measure of Fragility and Tail Risks: Application to Stress Testing.” IMF Working Paper WP/12/216.
- Library Referenced against empyrical’s beta_fragility_heuristic