Lower Tail Dependence
The Lower Tail Dependence measures how often two assets fall into their lowest returns together: the share of the periods in which one asset fell into its lowest alpha share of returns in which the other did too (Embrechts, McNeil and Straumann, 2002). It shows whether assets crash together, which the correlation, an average over all periods, does not.
The formula for the Lower Tail Dependence starts from the indicators \(L_{i , t}\) of a return of asset i at or below its alpha quantile in period t, with alpha the tail probability, and takes the share of the tail periods of asset i in which asset j is in its tail too, with the distance \(d_{i , j}\) its negative logarithm:
\[\lambda_{i,j} = \frac{\sum_{t=1}^{T} L_{i,t} \cdot L_{j,t}}{\sum_{t=1}^{T} L_{i,t}}\] \[d_{i,j} = -\ln\left(\lambda_{i,j}\right)\]A value of 1 means the two always crash together, 0 that they never share a tail period; with a tail of a few periods the estimate moves in large steps.
It is the codependence that the hierarchical optimizers (HRP, HERC, NCO) and get_asset_clusters take, or the distance they cluster on. Hierarchical portfolio construction groups the assets by how much they move together and spreads the capital across the groups, so the codependence decides which assets end up together. The Pearson correlation captures only linear co-movement on average; the other codependences capture co-movement in ranks, in large moves only, in any form of dependence or in crashes. Each comes with a distance, zero for assets that move as one, that the clustering works on (Mantegna, 1999).
Also known as: tail dependence matrix, lower tail dependence coefficient.
In the Finance Toolkit this is get_codependence_matrix with method="lower_tail", the same function as Codependence Matrix.
Example · AAPL, MSFT, JNJ, XOM · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_codependence_matrix:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT", "JNJ", "XOM"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.portfolio.get_codependence_matrix(method="lower_tail")
| Parameter | Type | Description | Example |
|---|---|---|---|
method | str | The codependence. Options are: “pearson” (Pearson Correlation), “spearman” (Spearman Rank Correlation), “kendall” (Kendall Rank Correlation), “gerber” (Gerber Statistic), “detoned” (Detoned Correlation), “distance” (Distance Correlation), “mutual_information” (Mutual Information), “lower_tail” (Lower Tail Dependence), “absolute_angular” (Absolute Angular Codependence), “squared_angular” (Squared Angular Codependence), “gnpr” (Generic Non-Parametric Representation Codependence). Defaults to “pearson”. | "pearson" |
period | str | The frequency of the returns. Options are: “daily” (daily returns), “weekly” (weekly returns), “monthly” (monthly returns), “quarterly” (quarterly returns), “yearly” (yearly returns). Defaults to “daily”. | "weekly" |
covariance | str | The covariance estimator whose correlation the Pearson codependence is (see get_covariance_estimate). Options are: “sample” (sample covariance), “ledoit_wolf” (Ledoit-Wolf), “ledoit_wolf_constant_correlation” (Ledoit-Wolf constant correlation), “ledoit_wolf_single_factor” (Ledoit-Wolf single factor), “oas” (Oracle Approximating Shrinkage), “shrunk” (fixed shrinkage), “semicovariance” (semicovariance), “exponential” (exponentially weighted), “denoised” (denoised, constant residual eigenvalue), “denoised_spectral” (denoised, spectral), “denoised_shrink” (denoised, targeted shrinkage), “gerber” (Gerber), “factor” (factor model), “minimum_covariance_determinant” (Minimum Covariance Determinant), “jlogo” (j-LoGo), “geodesic” (geodesic shrinkage), “regime_adjusted_ew” (regime adjusted exponentially weighted), “nercome” (NERCOME), “ccc_garch” (CCC-GARCH), “mm” (MM-estimator), “rocke” (Rocke’s S-estimator). Defaults to “sample”. | "sample" |
distance | bool | Whether to return the distance matrix the clustering works on instead. Defaults to False. | False |
gerber_threshold | float | The threshold of the Gerber statistic in standard deviations. Defaults to 0.5. | 0.5 |
gerber_statistic | int | The Gerber statistic. Options are: 0 (the original statistic), 1 (the positive semidefinite variant), 2 (the matrix form). Defaults to 1. | 1 |
components | int | The number of principal components the detoned correlation removes. Defaults to 1. | 1 |
bins | str | int | The number of histogram bins of the mutual information, or the rule per pair. Options are: “freedman” (Freedman and Diaconis, skfolio’s default), “hacine_gharbi” (Hacine-Gharbi, López de Prado’s choice), or an integer. Defaults to “freedman”. | "freedman" |
alpha | float | The share of the lowest returns that forms the tail of the lower tail dependence. Defaults to 0.05. | 0.01 |
gnpr_theta | float | The weight \(\theta\) of the co-movement in the GNPR distance, between 0 and 1. Defaults to 0.5. | 0.5 |
gnpr_bandwidth | float | The width of the histogram bins of the GNPR distance, in returns per period. Defaults to 0.01. | 0.01 |
include_benchmark | bool | Whether to include the benchmark as an asset. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding. | 2 |
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 |
Which returns:
| Item | AAPL | MSFT | JNJ | XOM |
|---|---|---|---|---|
| AAPL | 1.0000 | 0.4286 | 0.1905 | 0.1746 |
| MSFT | 0.4286 | 1.0000 | 0.1746 | 0.1111 |
| JNJ | 0.1905 | 0.1746 | 1.0000 | 0.0476 |
| XOM | 0.1746 | 0.1111 | 0.0476 | 1.0000 |
4 rows
References
- Paper Embrechts, P., McNeil, A. and Straumann, D. (2002). “Correlation and Dependence in Risk Management: Properties and Pitfalls.” In Risk Management: Value at Risk and Beyond, Cambridge University Press, 176-223.
- Library Referenced against Riskfolio-Lib’s ltdi_matrix (Lower Tail Dependence)