Elliptical Copulas

Definition

The easiest families of copulas are the one derived from known families of random vectors, and the first presented one are, generally, the Elliptical families (in particular, the Gaussian and Student families are very standard in the litterature).

Definition (Spherical and elliptical random vectors): A random vector $\bm X$ is said to be spherical if for all orthogonal matrix $\bm A \in O_d(\mathbb R)$, $\bm A\bm X \sim \bm X$.

For every matrix $\bm B$ and vector $\bm c$, the random vector $\bm B \bm X + \bm c$ is then said to be elliptical.

Spherical random vectors have several interesting properties. First, the shape of the distribution must be the same in every direction since it is stable by rotations. Moreover, their characteristic functions (c.f.) only depend on the norm of their arguments. Indeed, for any $\bm A \in O_d(\mathbb R)$,

\[\phi(\bm t) = \mathbb E\left(e^{\langle \bm t, \bm X \rangle}\right)= \mathbb E\left(e^{\langle \bm t, \bm A\bm X \rangle}\right) = \mathbb E\left(e^{\langle \bm A\bm t, \bm X \rangle}\right) = \phi(\bm A\bm t).\]

We can therefore express this characteristic function as $\phi(\bm t) = \psi(\lVert \bm t \rVert_2^2)$, where $\psi$ is a function that characterizes the spherical family, called the generator of the family. Any characteristic function that can be expressed as a function of the norm of its argument is the characteristic function of a spherical random vector, since $\lVert \bm A \bm t \rVert_2 = \lVert \bm t \rVert_2$ for any orthogonal matrix $\bm A$.

This class contains the (multivariate) Normal and Student distributions, and it is easy to construct others if needed. This is a generalization of the family of Gaussian random vectors, and they benefit from several nice properties of the former, among which, particularly interesting, the stability by convolution. Indeed, convolutions correspond to product of characteristic functions, and

\[\phi(\bm t) = \prod_{i=1}^n \phi_i(\bm t) = \prod_{i=1}^n \psi_i(\lVert \bm t \rVert_2^2) = \psi(\lVert \bm t \rVert_2^2),\]

which is still a function of only the norm of $\bm t$.

To fix ideas, for Gaussian random vectors, $\psi(t) = e^{-\frac{t^2}{2}}$.

Sampling with `Distributions.jl`

Elliptical random vectors in the Gaussian and Student families are available from Distributions.jl:

using Distributions
Σ = [1 0.5
    0.5 1] # variance-covariance matrix.
ν = 3 # number of degrees of freedom for the student.
N = MvNormal(Σ)
ZeroMeanFullNormal(
dim: 2
μ: Zeros(2)
Σ: [1.0 0.5; 0.5 1.0]
)
T = MvTDist(ν,Σ)
Distributions.GenericMvTDist{Float64, PDMats.PDMat{Float64, Matrix{Float64}}, FillArrays.Zeros{Float64, 1, Tuple{Base.OneTo{Int64}}}}(
df: 3.0
dim: 2
μ: Zeros(2)
Σ: [1.0 0.5; 0.5 1.0]
)

Elliptical copulas are simply copulas of elliptical distributions. This simplicity of definition is paid for in the expression of the copulas itself: the obtained function has usually no better expression than:

\[C = F \circ (F_1^{-1},...,F_d^{-1}),\]

where $F_i^{-1}$ denotes the almost-inverse of $F_i$, that is:

\[\forall u \in [0,1],\;F_i^{-1}(u) = \inf\left\{x :\, F_i(x) \ge u\right\},\]

and $F_i$ is usually hard to express from the elliptical assumptions.

Moreover, the form of dependence structures that can be reached inside this class is restricted. The elliptical copulas are parametrized by the corresponding univariate spherical generator and a correlation matrix, which is a very simple structure. See also [1315] for details on these copulas.

On the other hand, there exist performant estimators of high-dimensional covariance matrices, and a large theory is built on the elliptical assumption of high dimensional random vectors, see e.g., [1618] among others. See also [19] for a recent work on nonparametric estimation of the underlying univariate spherical distribution.

Note on internal implementation

If the exposition we just did on characteristic functions of Elliptical random vectors is fundamental to the definition of elliptical copulas, the package does not use this at all to function, and rather rely on the existence of multivariate and corresponding univariate families of distributions in Distributions.jl.

You can obtain these elliptical copulas by the following code:

using Copulas
Σ = [1 0.5
     0.5 1] # variance-covariance matrix.
ν = 3 # number of degrees of freedom for the student.
C_N = GaussianCopula(Σ)
C_T = TCopula(ν,Σ)

As already stated, the underlying code simply applies Sklar. In all generalities, you may define another elliptical copula by the following structure:

struct MyElliptical{d,T} <: EllipticalCopula{d,T}
    θ:T
end
U(::Type{MyElliptical{d,T}}) where {d,T} # Distribution of the univaraite marginals, Normal() for the Gaussian case. 
N(::Type{MyElliptical{d,T}}) where {d,T} # Distribution of the mutlivariate random vector, MvNormal(\Sigma) for the Gaussian case. 

However, not much other cases than the Gaussian and Elliptical one are really used in the literature.

Examples

To construct, e.g., a Student copula, you need to provide the Correlation matrix and the number of degree of freedom, as follows:

using Copulas, Distributions
Σ = [1 0.5
    0.5 1] # variance-covariance matrix.
ν = 3 # number of degrees of freedom
C = TCopula(ν,Σ)
TCopula{2, 3, Matrix{Float64}}(
Σ: [1.0 0.5; 0.5 1.0]
)

You can sample it and compute its density and distribution functions via the standard interface. We could try to fit a GaussianCopula on the sampled data, even if we already know that the tails will not be properly taken into account:

u = rand(C,1000)
Ĉ = fit(GaussianCopula,u) # to fit on the sampled data.
GaussianCopula{2, Matrix{Float64}}(
Σ: [1.0 0.47993999017817496; 0.47993999017817496 0.9999999999999998]
)

We see that the estimation we have on the correlation matrix is quite good, but rest assured that the tails of the distributions are not the same at all. To see that, let's plot the lower tail function (see [3]) for both copulas:

using Plots
chi(C,u) = 2 * log(1-u) / log(1 - 2u + cdf(C,[u,u])) -1
u = 0.5:0.03:0.99
plot(u,  chi.(Ref(C),u), label="True student copula")
plot!(u, chi.(Ref(Ĉ),u), label="Estimated Gaussian copula")
Example block output

Implementation

Copulas.EllipticalCopulaType
EllipticalCopula{d,MT}

This is an abstract type. It implements an interface for all Elliptical copulas. We construct internally elliptical copulas using the sklar's theorem, by considering the copula $C$ to be defined as :

\[C = F \circ (F_1^{-1},...,F_d^{-1}),\]

where $F$ and $F_1,...,F_d$ are respectively the multivariate distribution function of some elliptical random vector and the univariate distribution function of its marginals. For a type MyCop <: EllipitcalCopula, it is necessary to implement the following methods:

  • N(::Type{MyCOp}), returning the constructor of the elliptical random vector from its correlation matrix. For example, N(GaussianCopula) simply returns MvNormal from Distributions.jl.
  • U(::Type{MyCOp}), returning the constructor for the univariate marginal, usually in standardized form. For example, U(GaussianCopula) returns Normal from Distributions.jl.

From these two functions, the abstract type provides a fully functional copula.

Details

Recall the definition of spherical random vectors:

Definition (Spherical and elliptical random vectors): A random vector $\bm X$ is said to be spherical if for all orthogonal matrix $\bm A \in O_d(\mathbb R)$, $\bm A\bm X \sim \bm X$.

For every matrix $\bm B$ and vector $\bm c$, the random vector $\bm B \bm X + \bm c$ is then said to be elliptical.

Recall that spherical random vectors are random vectors which characteristic functions (c.f.) only depend on the norm of their arguments. Indeed, for any $\bm A \in O_d(\mathbb R)$,

\[\phi(\bm t) = \mathbb E\left(e^{\langle \bm t, \bm X \rangle}\right)= \mathbb E\left(e^{\langle \bm t, \bm A\bm X \rangle}\right) = \mathbb E\left(e^{\langle \bm A\bm t, \bm X \rangle}\right) = \phi(\bm A\bm t).\]

We can therefore express this characteristic function as $\phi(\bm t) = \psi(\lVert \bm t \rVert_2^2)$, where $\psi$ is a function that characterizes the spherical family, called the generator of the family. Any characteristic function that can be expressed as a function of the norm of its argument is the characteristic function of a spherical random vector, since $\lVert \bm A \bm t \rVert_2 = \lVert \bm t \rVert_2$ for any orthogonal matrix $\bm A$.

However, note that this is not how the underlying code is working, we do not check for validity of the proposed generator (we dont even use it). You can construct such an elliptical family using simply Sklar:

struct MyElliptical{d,T} <: EllipticalCopula{d,T}
    θ:T
end
U(::Type{MyElliptical{d,T}}) where {d,T} # Distribution of the univaraite marginals, Normal() for the Gaussian case. 
N(::Type{MyElliptical{d,T}}) where {d,T} # Distribution of the mutlivariate random vector, MvNormal(C.Σ) for the Gaussian case. 

These two functions are enough to implement the rest of the interface.

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
[3]
R. B. Nelsen. An Introduction to Copulas. 2nd ed Edition, Springer Series in Statistics (Springer, New York, 2006).
[13]
G. Frahm, M. Junker and A. Szimayer. Elliptical Copulas: Applicability and Limitations. Statistics & Probability Letters 63, 275–286 (2003).
[14]
E. Gómez, M. A. Gómez-villegas and J. M. Marín. A Survey on Continuous Elliptical Vector Distributions. Revista Matemática Complutense 16, 345–361 (2003).
[15]
M.-P. Côté and C. Genest. Dependence in a Background Risk Model. Journal of Multivariate Analysis 172, 28–46 (2019).
[16]
G. Elidan. Copulas in Machine Learning. In: Copulae in Mathematical and Quantitative Finance, Vol. 213, edited by P. Jaworski, F. Durante and W. K. Härdle (Springer Berlin Heidelberg, Berlin, Heidelberg, 2013); pp. 39–60.
[17]
J. Friedman, T. Hastie and R. Tibshirani. Applications of the Lasso and Grouped Lasso to the Estimation of Sparse Graphical Models (Technical report, Stanford University, 2010).
[18]
D. Müller and C. Czado. Dependence Modelling in Ultra High Dimensions with Vine Copulas and the Graphical Lasso. Computational Statistics & Data Analysis 137, 211–232 (2019).
[19]
A. Derumigny and J.-D. Fermanian. Identifiability and Estimation of Meta-Elliptical Copula Generators. Journal of Multivariate Analysis, 104962 (2022).