Dependence measures
The copula of a random vector fully encodes its dependence structure. However, copulas are infinite-dimensional objects and interpreting their properties can be difficult as the dimension increases. Therefore, the literature has introduced quantifications of the dependence structure that may be used as univariate (imperfect but useful) summaries of certain copula properties. We implement the most well-known ones in this package.
Main dependence metrics τ, ρ, β and γ
For a copula
For a copula
For a copula
where
For a copula
with
while
These dependence measures are very common when
Copulas.τ(C::Copula),Copulas.ρ(C::Copula),Copulas.β(C::Copula),Copulas.γ(C::Copula)provide the upper formulas, yielding a scalar whatever the dimension of the copula.StatsBase.corkendall(data),StatsBase.corspearman(data),Copulas.corblomqvist(data),Copulas.corgini(data)provide matrices of pairwise dependence metrics.
Thus, for a given copula C, the theoretical dependence measures can be obtained by τ(C), ρ(C), β(C), γ(C) (for the multivariate versions) and corkendall(C), corspearman(C), corblomqvist(C), and corgini(C) (for the matrix versions). Similarly, empirical versions of these metrics can be obtained from a matrix of observations data of size (d,n) by Copulas.τ(data), Copulas.ρ(data), Copulas.β(data), Copulas.γ(data), StatsBase.corkendall(data), StatsBase.corspearman(data), Copulas.corblomqvist(data) and Copulas.corgini(data).
Kendall's
0 if and only if the copula is a
IndependentCopula.-1 is and only if the copula is a
WCopula.1 if and only if the copula is a
MCopula.
They do not depend on the marginals. This is why we say that they measure the 'strength' of the dependency.
The package implements generic version of the dependence metrics, but some families have faster versions (closed form formulas or better integration paths). However, all the potential fast-paths are not implemented yet. If you feel a specific method for a certain copula is missing, do not hesitate to open an issue !
Moreover, many copula estimators are based on the relationship between parameters and these coefficients (see e.g., [16–18]), but once again our implementation is not complete yet.
Here is for example the relationship between the Kendall
using Copulas, Plots, Distributions
θs = -1:0.1:5
τs = [Copulas.τ(ClaytonCopula(2, θ)) for θ in θs]
plot(θs, τs; xlabel="θ", ylabel="τ", title="θ -> τ for bivariate Clayton", legend=false)
Remark the clear and easy to exploit bijection.
In practice, Gini’s γ is the most efficient dependence measure in our implementation (microseconds, no allocations). Kendall’s τ is the most computationally expensive ((O(n^2))), while Spearman’s ρ and Blomqvist’s β are intermediate. For pairwise matrices, corgini is faster than both corblomqvist and the classical corspearman/corkendall.
Tail dependency
Many people are interested in the tail behavior of their dependence structures. Tail coefficients summarize this tail behavior.
For a copula
Simetric tools can be constructed for the lower tail:
When
using Copulas, Distributions, Plots
λᵤ(C::Copulas.Copula{d}, u) where d = (1 - 2u - cdf(C, fill(u,d)))/(1-u)
χᵤ(C::Copulas.Copula{d}, u) where d = 2 * log1p(- u) / log1p(- 2u + cdf(C, fill(u,d))) - 1
C = GumbelCopula(2, 2.5)
plot(0.9:0.001:0.999, Base.Fix1(λᵤ, C); xlabel="u", label="λᵤ(u)", title="Graph of λᵤ(u) and χᵤ(u) for Gumbel Copula")
plot!(0.9:0.001:0.999, Base.Fix1(χᵤ, C); label="χᵤ(u)")
C = ClaytonCopula(2, 2.5)
plot(0.9:0.001:0.999, Base.Fix1(λᵤ, C); xlabel="u", label="λᵤ(u)", title="Graph of λᵤ(u) and χᵤ(u) for Clayton Copula")
plot!(0.9:0.001:0.999, Base.Fix1(χᵤ, C); label="χᵤ(u)")
All these coefficients quantify the behavior of the dependence structure, generally or in the extremes, and are therefore widely used in the literature either as verification tools to assess the quality of fits, or even as parameters. Many parametric copula families have simple surjections, injections, or even bijections between these coefficients and their parametrization, allowing matching procedures of estimation (similar to moment matching algorithms for fitting standard random variables).
The package provides both theoretical limits (for a given copula object) and empirical estimators (from data matrices). In addition, pairwise tail-dependence matrices can be computed for multivariate samples.
Theoretical λ:
λₗ(C::Copula)andλᵤ(C::Copula)Shortcuts:λₗ(C),λᵤ(C)Empirical λ:
λₗ(U::AbstractMatrix; p=1/√m)andλᵤ(U::AbstractMatrix; p=1/√m)Pairwise λ-matrix:
coruppertail(data; method=:SchmidtStadtmueller, p=1/√m)andcorlowertail(data; method=:SchmidtStadtmueller, p=1/√m)
These follow the approach of Schmidt & Stadtmüller (see [19]).
The formalization of an interface for obtaining the tail dependence coefficients of copulas is still a work in progress in the package. Do not hesitate to reach us on GitHub if you want to discuss it!
Copula entropy
For a copula
Ma & Sun (2011) proved that the mutual information of a random vector equals the negative copula entropy:
See [20].
Basic properties if the copula entropy:
with equality IndependentCopula (because
For singular copulas (without density),
. Since
, the larger the , the greater the dependence (linear, nonlinear, tailing, etc.).
Remark that the iota symbol can be obtain by typing "\iota<tab>".
Our implementation proposes two options:
Parametric (Monte Carlo):
ι(C::Copula; nmc=100_000)ReturnsHNon-parametric (kNN):
ι(U::AbstractMatrix; k=5, p=Inf): uses a Kozachenko–Leonenko estimator ([21]) on pseudo-observations. Typical parameters: ; norm . Pairwise version:
corentropy(data; k=5, p=Inf): Matrices offor all pairs; signed=truemultipliesby .
While γ is fastest, whereas entropy and corentropy are orders of magnitude slower. They are therefore recommended mainly for validation, model selection, or feature screening, not routine use.
References
J. Behboodian, A. Dolati and M. Úbeda-Flores. A multivariate version of Gini's rank association coefficient. Statistical Papers 48, 295–304 (2007).
C. Genest, J. Nešlehová and N. Ben Ghorbal. Estimators Based on Kendall's Tau in Multivariate Copula Models. Australian & New Zealand Journal of Statistics 53, 157–177 (2011).
G. A. Fredricks and R. B. Nelsen. On the Relationship between Spearman's Rho and Kendall's Tau for Pairs of Continuous Random Variables. Journal of Statistical Planning and Inference 137, 2143–2150 (2007).
A. Derumigny and J.-D. Fermanian. À propos des tests de l'hypothèse simplificatrice pour les copules conditionnelles. JDS2017, 6 (2017).
R. Schmidt and U. Stadtmüller. Non-parametric estimation of tail dependence. Scandinavian journal of statistics 33, 307–335 (2006).
J. Ma and Z. Sun. Mutual information is copula entropy. Tsinghua Science and Technology 16, 51–54 (2011).
L. Kozachenko. Sample estimate of the entropy of a random vector. Probl. Pered. Inform. 23, 9 (1987).