Tail Dependence Coefficient
Calculate the Upper and Lower Tail Dependence Coefficients between ticker_a and ticker_b. Without a pair, every ticker is paired with the benchmark, which tells how likely each company is to be in distress when the market is.
Correlation only captures the average co-movement between two assets – it says nothing about whether they are more likely to crash together than an equivalent gaussian relationship would imply. The Tail Dependence Coefficient answers that specific question directly: the probability that one asset is in extreme distress, given that the other one already is.
The empirical estimate at q = 0.95 rests on the few days on which both assets are in their worst (or best) 5% at the same time, so it needs several years of daily data to be stable. A gaussian dependence of any correlation below 1 implies zero tail dependence, so a Lower Tail Dependence Coefficient well above zero means that diversification between the two assets is weakest exactly when it is needed.
For more information about the method, see the following papers:
- Embrechts, P., McNeil, A., & Straumann, D. (1999). “Correlation: Pitfalls and Alternatives.” RISK Magazine, 12, 69-71.
- Poon, S.H., Rockinger, M., & Tawn, J. (2004). “Extreme Value Dependence in Financial Markets: Diagnostics, Models, and Financial Implications.” Review of Financial Studies, 17(2), 581-610.
The formula is as follows (with the default method=”empirical” and q=0.95):
\[\text{Upper Tail Dependence} = \operatorname{\#}(A > Q_{A}(q) \text{and}\; B > Q_{B}(q)) / \operatorname{\#}(A > Q_{A}(q))\] \[\text{Lower Tail Dependence} = \operatorname{\#}(A \leq Q_{A}(1 - q) \text{and}\; B \leq Q_{B}(1 - q)) / \operatorname{\#}(A \leq Q_{A}(1 - q))\]Where A and B are the values of ticker_a and ticker_b on their common dates and Q_A and Q_B their empirical quantiles. With method=”gaussian” both coefficients are 0 (1 only for a correlation of exactly 1), and with method=”student-t” both are 2 * t_(v+1)(-√((v + 1) * (1 - rho) / (1 + rho))), with v = dof, rho the Pearson correlation and t_(v+1) the Student-T distribution function.
Also known as: tail dependence, extremal dependence coefficient.
Tail Dependence Coefficient in Python
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_tail_dependence_coefficient as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "JPM", "XOM", "^STOXX50E"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_tail_dependence_coefficient()
Which returns:
| Lower Tail Dependence | Upper Tail Dependence | Correlation | Observations | |
|---|---|---|---|---|
| AAPL | 0.4545 | 0.4769 | 0.7593 | 1290 |
| JPM | 0.4 | 0.3846 | 0.622 | 1290 |
| XOM | 0.2424 | 0.2154 | 0.3408 | 1290 |
| ^STOXX50E | 0.3231 | 0.3438 | 0.4449 | 1289 |
Parameters
get_tail_dependence_coefficient accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
ticker_a | str | None | The first asset. Defaults to None, which pairs every other ticker in the Toolkit instance (the benchmark included when ticker_b is given) with ticker_b. | "AAPL" |
ticker_b | str | None | The second asset. Defaults to None, which uses the benchmark. | "MSFT" |
period | str | The data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”, since a dependence estimate needs far more observations than a lower frequency provides – at “yearly” a decade of history is only ten observations. | "weekly" |
column | str | The historical data column to use. Defaults to “Return”, since tail dependence between return series is the standard risk management application. | "Return" |
q | float | The threshold quantile used for the “empirical” method, in (0.5, 1). Defaults to 0.95. | 0.9 |
method | str | The estimation method, one of “empirical”, “gaussian” or “student-t”. Defaults to “empirical”. | "student-t" |
dof | float | The degrees of freedom of the Student-T copula, only used when method="student-t". Defaults to 4.0. | 6.0 |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |