Calibrate a bivariate copula between ticker_a and ticker_b, via maximum likelihood.

When ticker_a/ticker_b are not given, every unique pair among the Toolkit’s tickers is calibrated instead.

A copula separates the dependence structure between two assets from their individual (marginal) return distributions (Sklar’s theorem), letting the two be modeled independently. Five families are supported, each capturing a different shape of dependence:

  • “gaussian”: zero tail dependence – crashes and rallies are no more likely to happen together than the correlation alone implies. Included mainly as a baseline, since real asset returns typically show more joint tail risk than this.
  • “student-t”: symmetric, nonzero tail dependence in both tails.
  • “clayton”: nonzero lower tail dependence only – assets crash together more than they rally together. The most common choice for equity return pairs.
  • “gumbel”: nonzero upper tail dependence only – assets rally together more than they crash together.
  • “frank”: zero tail dependence in both tails, but (unlike gaussian) can represent negative dependence and is symmetric around independence.

See get_best_fitting_copula to compare all five by AIC on the same pair of assets, and see get_copula_simulation to draw joint scenarios from the fitted copula.

For more information about the method, see:

  • Sklar, A. (1959). Publications de l’Institut de Statistique de l’Universite de Paris, 8, 229-231.
  • McNeil, A.J., Frey, R., & Embrechts, P. (2015). “Quantitative Risk Management: Concepts, Techniques and Tools.” Princeton University Press.
  • Demarta, S., & McNeil, A.J. (2005). “The T Copula and Related Copulas.” International Statistical Review, 73(1), 111-129.

Also known as: copula calibration, copula fit, dependence modeling.

Copula Parameters in Python

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

pip install financetoolkit -U

Then call get_copula_parameters as shown below.

from financetoolkit import Toolkit

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

toolkit.risk.get_copula_parameters("AAPL", "MSFT", copula="clayton", period="weekly")

Which returns:

  Value
Theta 0.7342
Lower Tail Dependence 0.389
Upper Tail Dependence 0
Log-Likelihood 33.6247
AIC -65.2495
Observations 314

Parameters

get_copula_parameters accepts the following parameters:

  • ticker_a (str, optional): The first asset. Defaults to None, meaning every unique pair of tickers in the Toolkit instance is calibrated (requires ticker_b to also be None).
  • ticker_b (str, optional): The second asset. Defaults to None, see ticker_a.
  • copula (str, optional): The copula family to fit, one of “gaussian”, “student-t”, “clayton”, “gumbel” or “frank”. Defaults to “gaussian”.
  • 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”.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Share