spxa

Copulas and Multivariate Dependence

A copula separates a joint distribution into its marginals and a dependence structure. This lets each asset keep its own process from the zoo while the coupling is modelled separately. spxa.copula provides elliptical, Archimedean and extreme-value families, exact concordance and tail-dependence measures, conditional sampling, rank-based estimation, and multi-asset simulation.

Object Implementation
Abstract copula, Rosenblatt transforms, Fréchet–Hoeffding bounds spxa.copula.Copula
Independence / comonotonic / countermonotonic IndependenceCopula, ComonotonicityCopula, CountermonotonicityCopula
Elliptical GaussianCopula, StudentTCopula
Archimedean ClaytonCopula, GumbelCopula, FrankCopula, JoeCopula, AliMikhailHaqCopula
Extreme value GalambosCopula, HuslerReissCopula
Estimation and selection pseudo_observations, fit_copula, select_best_copula
Coupled multi-asset simulation and pricing CoupledProcess

1. Sklar’s theorem

A $d$-dimensional copula is a distribution function on $[0,1]^d$ with uniform marginals. By Sklar’s theorem (1959), every joint distribution $H$ with marginals $F_1,\dots,F_d$ can be written as

\[H(x_1,\dots,x_d) = C\big(F_1(x_1),\dots,F_d(x_d)\big),\]

and $C$ is unique on $\operatorname{Ran}F_1\times\cdots\times\operatorname{Ran}F_d$. In particular $C$ is unique when the marginals are continuous. Conversely, any copula combined with any marginals gives a valid joint law. With densities,

\[h(x) = c\big(F_1(x_1),\dots,F_d(x_d)\big)\prod_{j=1}^d f_j(x_j), \qquad c = \frac{\partial^d C}{\partial u_1\cdots\partial u_d}.\]

Copulas are invariant under strictly increasing transformations of the coordinates. Rank statistics, such as Kendall’s $\tau$ and Spearman’s $\rho_S$, are functions of $C$ alone. Every copula lies between the Fréchet–Hoeffding bounds (Copula.frechet_hoeffding_bounds):

\[W(u) = \max\Big(\textstyle\sum_j u_j - d + 1,\ 0\Big) \;\le\; C(u) \;\le\; M(u) = \min_j u_j .\]

$M$ is the comonotonic copula. $W$ is a copula only for $d=2$, where it is the countermonotonic copula.


2. Dependence measures

Concordance.

\[\tau = 4\int_{[0,1]^2} C\,dC - 1, \qquad \rho_S = 12\int_{[0,1]^2} C(u,v)\,du\,dv - 3 .\]

Tail dependence is the probability of joint extremes:

\[\lambda_L = \lim_{q\downarrow0}\frac{C(q,q)}{q}, \qquad \lambda_U = \lim_{q\uparrow1}\frac{1 - 2q + C(q,q)}{1-q}.\]
Tail dependence is what separates the families in risk applications. The Gaussian copula is asymptotically independent in both tails whenever $ \rho < 1$: joint crashes become rare in the limit, however high the correlation. This is a well-known limitation in credit and stress testing.
Copula Parameter Kendall’s $\tau$ $\lambda_L$ $\lambda_U$
Gaussian $\rho$ $\frac{2}{\pi}\arcsin\rho$ 0 0
Student-$t$ $\rho,\ \nu$ $\frac{2}{\pi}\arcsin\rho$ $2\,t_{\nu+1}!\left(-\sqrt{\frac{(\nu+1)(1-\rho)}{1+\rho}}\right)$ $=\lambda_L$
Clayton $\theta>0$ $\frac{\theta}{\theta+2}$ $2^{-1/\theta}$ 0
Gumbel $\theta\ge1$ $1-\frac1\theta$ 0 $2-2^{1/\theta}$
Frank $\theta\ne0$ $1 - \frac4\theta\big(1 - D_1(\theta)\big)$ 0 0
Joe $\theta\ge1$ $1 + 4\int_0^1 \frac{\varphi(t)}{\varphi’(t)}dt$ 0 $2-2^{1/\theta}$
AMH $\theta\in[-1,1)$ closed form via $\log(1-\theta)$ and $\operatorname{Li}_2$ 0 0
Galambos $\theta>0$ numerical 0 $2^{-1/\theta}$
Hüsler–Reiss $\theta>0$ numerical 0 $2\,\Phi(-1/\theta)$

Here $D_1(\theta) = \frac1\theta\int_0^\theta \frac{t}{e^t-1}dt$ is the Debye function. The kendall_tau(), spearman_rho() and tail_dependence() methods return these quantities. Where the right-hand column has a closed form, it is the one used.


3. Families

3.1 Elliptical copulas

Elliptical copulas are extracted from elliptical distributions with correlation matrix $R$:

\[C^{\text{Ga}}_R(u) = \Phi_R\big(\Phi^{-1}(u_1),\dots,\Phi^{-1}(u_d)\big), \qquad C^{t}_{R,\nu}(u) = t_{R,\nu}\big(t_\nu^{-1}(u_1),\dots,t_\nu^{-1}(u_d)\big).\]

They support any dimension and any valid correlation matrix. A supplied matrix is checked for symmetry, unit diagonal and positive definiteness. The relation $\tau = \frac2\pi\arcsin\rho$ holds for every elliptical copula, so $\rho$ can be estimated robustly from Kendall’s $\tau$. The Student-$t$ copula adds symmetric tail dependence, controlled by $\nu$. As $\nu\to\infty$ it reduces to the Gaussian copula.

3.2 Archimedean copulas

An Archimedean copula is generated by a completely monotone generator $\psi:[0,\infty)\to[0,1]$ (the inverse of $\varphi = \psi^{-1}$):

\[C(u) = \psi\big(\varphi(u_1) + \cdots + \varphi(u_d)\big).\]
Family Generator $\varphi(t)$
Clayton $\frac1\theta(t^{-\theta}-1)$
Gumbel $(-\log t)^\theta$
Frank $-\log\frac{e^{-\theta t}-1}{e^{-\theta}-1}$
Joe $-\log\big(1-(1-t)^\theta\big)$
AMH $\log\frac{1-\theta(1-t)}{t}$

For Archimedean copulas, Kendall’s $\tau$ reduces to a one-dimensional integral (Genest & MacKay 1986):

\[\tau = 1 + 4\int_0^1 \frac{\varphi(t)}{\varphi'(t)}\,dt .\]
Sampling is done by conditional inversion: draw $u_1, w \sim U(0,1)$ and set $u_2 = C_{2 1}^{-1}(w\mid u_1)$. The inverse is closed-form for Clayton and Frank and numerical otherwise. Gumbel uses the stable-mixture (Marshall–Olkin) representation.

3.3 Extreme-value copulas

Extreme-value copulas are the possible limits of copulas of componentwise maxima. In two dimensions they are characterised by a convex Pickands dependence function $A:[0,1]\to[\tfrac12,1]$ with $\max(t,1-t)\le A(t)\le 1$:

\[C(u,v) = \exp\!\Big(\log(uv)\,A\Big(\frac{\log v}{\log(uv)}\Big)\Big), \qquad \lambda_U = 2\big(1 - A(\tfrac12)\big).\]

ExtremeValueCopula.pickands_a evaluates $A$ for Galambos, $A(t) = 1 - (t^{-\theta} + (1-t)^{-\theta})^{-1/\theta}$, and for Hüsler–Reiss, $A(t) = (1-t)\,\Phi\big(\frac1\theta + \frac\theta2\log\frac{1-t}{t}\big) + t\,\Phi\big(\frac1\theta + \frac\theta2\log\frac{t}{1-t}\big)$.

3.4 Rosenblatt transform

The Rosenblatt transform maps $U\sim C$ to independent uniforms:

\[W_1 = U_1,\quad W_2 = C_{2|1}(U_2\mid U_1),\quad\dots\]
Here $C_{2 1}(v\mid u) = \partial_u C(u,v)$ (conditional_cdf). The inverse transform (inverse_rosenblatt_transform) is the generic sampler. The forward transform is the basis of goodness-of-fit tests: transformed data should be i.i.d. uniform.

4. Estimation

The marginals are usually unknown or misspecified, so dependence is estimated from pseudo-observations (ranks):

\[\hat U_{ij} = \frac{\operatorname{rank}(X_{ij})}{n+1}\]

(pseudo_observations). This makes estimation of $C$ independent of any marginal model. fit_copula(u, family, method) supports two methods.

select_best_copula fits a list of candidate families by CML and ranks them by $\text{AIC} = 2k - 2\log\hat L$. The candidates should include at least one family with lower and one with upper tail dependence, so that the choice is driven by the data and not by the candidate set.


5. Coupled processes

CoupledProcess(processes, copula) simulates $d$ univariate zoo processes jointly. At every time step it draws $U\sim C$, maps it to Gaussian drivers $Z_j = \Phi^{-1}(U_j)$, and uses $Z_j$ as the diffusive innovation of marginal $j$. This leaves each marginal’s one-step diffusive law unchanged while imposing the copula on the innovations. The class also provides Monte Carlo prices for multi-asset payoffs: basket_call_price, worst_of_call_price, best_of_call_price and spread_option_price.

!!! warning “Which object carries the copula” The copula is imposed on one-step innovations, not on the joint law of the terminal values. Aggregating many increments changes the dependence structure. By the multivariate central limit theorem, the copula of $(X^1_T, X^2_T)$ for diffusive marginals tends towards a Gaussian copula with correlation equal to the innovation correlation $\operatorname{Corr}(Z_1,Z_2)$. Most of the tail dependence of a Clayton or Gumbel innovation copula therefore disappears over long horizons. To control the dependence of terminal values directly, sample $U\sim C$ once and apply the marginal quantile functions of $X^j_T$.

!!! note “Scope of the marginal dynamics” CoupledProcess.simulate currently has explicit dynamics for Brownian, CIR (full-truncation Euler), Merton and Kou jump-diffusion marginals. Jump arrivals are independent across assets. Heston and Bates marginals are stepped with their variance frozen at $\sqrt{v_0}$. Any other process type silently falls back to a geometric Euler step with a hard-coded 5% drift and 20% volatility that ignore the process’s own parameters. Results for such marginals are wrong. Simulate them individually and couple their innovations explicitly.


References