Financial Turbulence

Calculate the Financial Turbulence of the Toolkit’s tickers: how unusual their returns of a day are given their history, in the size of the moves and in how they move together, split into the Magnitude Surprise and the Correlation Surprise.

Kritzman and Li (2010) measure turbulence as the Mahalanobis distance of the day’s returns of a set of assets from their historical mean, which uses the historical covariance matrix: a day is turbulent when the returns are large given the volatilities, or when assets that usually move together move apart (or the other way around). Turbulent days cluster, and the returns of risk premia are lower while they last. Kinlaw and Turkington (2014) split the turbulence into a Magnitude Surprise, the same distance without the correlations, and a Correlation Surprise, the ratio of the two. Periods of high Correlation Surprise were followed by higher volatility and lower returns than periods with the same Magnitude Surprise and usual correlations.

The formula is as follows:

\[\text{Turbulence} = \frac{d' \cdot \Sigma^{-1} \cdot d}{N}\] \[\text{Magnitude Surprise} = \frac{d' \cdot D^{-1} \cdot d}{N}\] \[\text{Correlation Surprise} = \frac{\text{Turbulence}}{\text{Magnitude Surprise}}\] \[\text{where}\;\; d = y - \mu\]

Where y are the returns of the N tickers on the day, mu and Sigma the mean and the sample covariance matrix (with n - 1 in the denominator) of their returns before that day and D the diagonal of Σ (the variances, without the correlations). The division by N follows Kinlaw and Turkington, so the Turbulence and the Magnitude Surprise average about 1, and above 1 the day is more unusual than an average day. A Correlation Surprise above 1 means the tickers moved against their usual correlations. The history starts with 756 daily returns (3 years) and grows to the last 2520 (10 years), as in Kinlaw and Turkington.

Also known as: financial turbulence, turbulence index, Mahalanobis distance, correlation surprise, magnitude surprise, multivariate unusualness.

Example · XLB, XLE, XLF, XLI, 5 more · 2018 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_financial_turbulence:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["XLB", "XLE", "XLF", "XLI", "XLK", "XLP", "XLU", "XLV", "XLY"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2018-01-01",
    end_date="2025-12-31",
)

toolkit.risk.get_financial_turbulence().loc["2025-04-01":"2025-04-11"]

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

How turbulent were the daily returns of the nine original Select Sector SPDR ETFs on each trading day from 1 to 11 April 2025, split into magnitude and correlation surprises, with data from 2018?

Which returns:

Parameters

get_financial_turbulence accepts the following parameters.

ParameterTypeDescriptionExample
windowintThe largest number of earlier daily returns the mean and covariance matrix are estimated from. Defaults to 2520 (10 years).20
minimum_periodsintThe fewest earlier daily returns a day needs, at most window. Defaults to 756 (3 years).756 (3 years)
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the 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
transformstr | list[str] | NoneTime series steps applied in order, such as “sma:12” (moving average), “ema:12”, “std:12”, “zscore:60”, “percentile:120”, “yoy”, “pct_change:3,annualize:3”, “log”, “diff”, “cumsum” or “hp_trend” and “hp_cycle” (Hodrick-Prescott), before growth. A window needs that many periods of history, so the first periods can be empty. Defaults to None.None
show_columnsstr | list[str] | NoneThe 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 Kritzman, M. and Li, Y. (2010). “Skulls, Financial Turbulence, and Risk Management.” Financial Analysts Journal, 66(5), 30-41.
  • Paper Kinlaw, W. and Turkington, D. (2014). “Correlation Surprise.” Journal of Asset Management, 14(6), 385-399.
  • Paper Chow, G., Jacquier, E., Kritzman, M. and Lowry, K. (1999). “Optimal Portfolios in Good Times and Bad.” Financial Analysts Journal, 55(3), 65-73.
  • Library Shares similar logic as scipy’s mahalanobis
Share