Calculate the Upper and Lower Tail Dependence Coefficients between ticker_a and ticker_b.

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.

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.

Also known as: tail dependence, extremal dependence coefficient.

Tail Dependence Coefficient in Python

get_tail_dependence_coefficient is part of the Risk module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_tail_dependence_coefficient as shown below.

from financetoolkit import Toolkit

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

toolkit.risk.get_tail_dependence_coefficient("AAPL", "MSFT", period="weekly")

Which returns:

Metric Value
Lower Tail Dependence 0.25
Upper Tail Dependence 0.375
Correlation 0.7602
Observations 157

Parameters

get_tail_dependence_coefficient accepts the following parameters:

  • ticker_a (str): The first asset.
  • ticker_b (str): The second asset.
  • period (str, optional): 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.
  • column (str, optional): The historical data column to use. Defaults to “Return”, since tail dependence between return series is the standard risk management application.
  • q (float, optional): The threshold quantile used for the “empirical” method, in (0.5, 1). Defaults to 0.95.
  • method (str, optional): The estimation method, one of “empirical”, “gaussian” or “student-t”. Defaults to “empirical”.
  • dof (float, optional): The degrees of freedom of the Student-T copula, only used when method="student-t". Defaults to 4.0.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Share