Extreme Value family
Extreme value copulas are fundamental in the study of rare and extreme events due to their ability to model dependency in situations of extreme risk. This package provides a wide selection of bivariate extreme value copulas; multivariate cases are not yet implemented. Feel free to open an issue or propose a pull request if you want to contribute a multivariate case.
The implementation here only deals with bivariate extreme value copulas. Multivariate cases are more tedious to implement, but not impossible: if you want to propose an implementation, we can provide guidance on how to merge it here. Do not hesitate to reach us on GitHub.
A bivariate extreme value copula [44]
It can be represented through its stable tail dependence function
or through a convex function
In the context of bivariate extreme value copulas, the functions
In our implementation, it is sufficient to provide the Pickands dependence function
In this package, there is an abstract type ExtremeValueCopula that provides a foundation for defining bivariate extreme value copulas. Many extreme value copulas are already implemented for you! See this list to get an overview.
If you do not find the one you need, you may define it yourself by subtyping ExtremeValueCopula. The API requires only a method for the Pickands function A(C::ExtremeValueCopula) = .... By providing this function, you can easily create a new extreme value copula that fits your specific needs:
struct MyExtremeValueCopula{P} <: ExtremeValueCopula{P}
θ::P
end
A(C::ExtremeValueCopula, t) = (t^C.θ + (1 - t)^C.θ)^(1/C.θ) # This is the Pickands function of the Logistic (Gumbel) CopulaWhen you have bivariate data and want a nonparametric Extreme Value copula, you can estimate the Pickands function from pseudo-observations using EmpiricalEVTail and plug it into an ExtremeValueCopula. For convenience, EmpiricalEVCopula(u) builds the EV copula in one step. See the bestiary entry for EmpiricalEVTail and ExtremeValueCopula docs for details.
Advanced Concepts
Here, we present some important concepts from the theory of extreme value copulas that are useful for the development of this package.
Let
Let
where
Since
This result was demonstrated by Deheuvels (1991) [46] in the case where
Simulation of Bivariate Extreme Value Distributions
To simulate a bivariate extreme value distribution
Assume
The conditional distribution of
which simplifies to:
Given
Since
For the class of Extreme Value Copulas, We follow the methodology proposed by Ghoudi,1998. page 191. [45]. Here, is a detailed algorithm for sampling from bivariate Extreme Value Copulas:
::: algorithm Bivariate Extreme Value Copulas sampling
Simulate
Simulate
Select
with probability and with probability Return
and
:::
Note that all functions present in the algorithm were previously defined to ensure that the implemented methodology has a solid theoretical basis.
Copulas.Tail Type
TailAbstract type. Implements the API for stable tail dependence functions (STDFs) of extreme-value copulas in dimension d.
A STDF is a function
Pickands representation. By homogeneity, for
Interface.
A(tail::Tail, ω::NTuple{d,Real})— Pickands function on the simplex\Delta_{d-1}. (Ford=2, a convenienceA(tail::Tail{2}, t::Real)may be provided.)ℓ(tail::Tail, x::NTuple{d,Real})— STDF. By default the package definesℓ(tail, x) = ‖x‖₁ * A(tail, x/‖x‖₁)whenAis available.
We do not algorithmically verify convexity/bounds; implementers are responsible for validity.
Additional helpers (with defaults).
For
d=2:dA,d²Avia AD; stablelogpdf/rand(Ghoudi sampler).In any
d:cdf(u) = exp(-ℓ(-log.(u))).
References:
Pickands (1981); Gudendorf & Segers (2010); Ghoudi, Khoudraji & Rivest (1998); de Haan & Ferreira (2006).
Rasell
Copulas.ExtremeValueCopula Type
ExtremeValueCopula{d, TT}Constructor
ExtremeValueCopula(d, tail::Tail)Extreme-value copulas model tail dependence via a stable tail dependence function (STDF)
For
Usage
Provide any valid tail
tail::Tail(which implementsAand/orℓ) to construct the copula.Sampling, cdf, and logpdf follow the standard
Distributions.jlAPI.
Example
C = ExtremeValueCopula(2, GalambosTail(θ))
U = rand(C, 1000)
logpdf.(Ref(C), eachcol(U))References:
[44] G., & Segers, J. (2010). Extreme-value copulas. In Copula Theory and Its Applications (pp. 127-145). Springer.
[4] Joe, H. (2014). Dependence Modeling with Copulas. CRC Press.
[47] Mai, J. F., & Scherer, M. (2014). Financial engineering with copulas explained (p. 168). London: Palgrave Macmillan.
Conditionals and distortions
For any copula
and, for a single coordinate
For a bivariate extreme value copula with Pickands function
so the above derivatives can be written explicitly in terms of
Visual illustrations
Pickands dependence functions A(t)
using Copulas, Plots, Distributions
ts = range(0.0, 1.0; length=401)
Cs = (
GalambosCopula(2, 0.8), # upper tail dep.
HuslerReissCopula(2, 1.0), # intermediate
LogCopula(2, 1.6), # asymmetric
)
labels = ("Galambos(0.8)", "Hüsler–Reiss(1.0)", "Log(1.6)")
plot(size=(700, 300))
for (i, C) in enumerate(Cs)
plot!(ts, Copulas.A.(C.tail, ts); label=labels[i])
end
plot!(ts, max.(ts, 1 .- ts); label="bounds", ls=:dash, color=:black)
plot!(ts, ones(length(ts)); label="1", ls=:dot, color=:gray)
Sample scatter (uniform scale)
C = GalambosCopula(2, 1.0)
plot(C, title="Galambos copula sample")
Conditional distortion (EV example)
C = HuslerReissCopula(2, 1.2)
u2 = 0.4
D = condition(C, 2, u2)
ts = range(0.0, 1.0; length=401)
plot(ts, cdf.(Ref(D), ts); xlabel="u", ylabel="H_{1|2}(u|u₂=0.4)",
title="Conditional distortion for Hüsler–Reiss")
Rosenblatt sanity check (EV)
using StatsBase
U = rand(C, 2000)
S = reduce(hcat, (rosenblatt(C, U[:, i]) for i in 1:size(U,2)))
ts = range(0.0, 1.0; length=401)
EC = [ecdf(S[k, :]) for k in 1:2]
plot(ts, ts; label="Uniform", color=:blue, alpha=0.6, size=(650,300))
plot!(ts, EC[1].(ts); seriestype=:steppost, label="s₁", color=:black)
plot!(ts, EC[2].(ts); seriestype=:steppost, label="s₂", color=:gray)
Available models
MTail
NoTail
Copulas.NoTail Type
NoTailCorresponds to the case where the pickads function is identically One, which means no particular tail behavior.
sourceAsymGalambosTail
Copulas.AsymGalambosTail Type
AsymGalambosTail{T}, AsymGalambosCopula{T}Fields:
α::Real — dependence parameter
θ₁::Real — asymmetry weight in [0,1]
θ₂::Real — asymmetry weight in [0,1]
Constructor
AsymGalambosCopula(α, θ₁, θ₂)
ExtremeValueCopula(2, AsymGalambosTail(α, θ₁, θ₂))The (bivariate) asymmetric Galambos extreme-value copula is parameterized by
Special cases:
α = 0 ⇒ IndependentCopula
θ₁ = θ₂ = 0 ⇒ IndependentCopula
θ₁ = θ₂ = 1 ⇒ GalambosCopula
References:
- [48] Families of min-stable multivariate exponential and multivariate extreme value distributions. Statist. Probab, 1990.
AsymLogTail
Copulas.AsymLogTail Type
AsymLogTail{T}, AsymLogCopula{T}Fields:
α::Real — dependence parameter (α ≥ 1)
θ₁::Real — asymmetry weight in [0,1]
θ₂::Real — asymmetry weight in [0,1]
Constructor
AsymLogCopula(α, θ₁, θ₂)
ExtremeValueCopula(2, AsymLogTail(α, θ₁, θ₂))The (bivariate) asymmetric logistic extreme–value copula is parameterized by α ∈ [1, ∞) and θ₁, θ₂ ∈ [0,1]. Its Pickands dependence function is
Special cases:
θ₁ = θ₂ = 1 ⇒ symmetric Logistic (Gumbel) copula
θ₁ = θ₂ = 0 ⇒ independence (A(t) ≡ 1)
References:
- [49] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
AsymMixedTail
Copulas.AsymMixedTail Type
AsymMixedTail{T}, AsymMixedCopula{T}Fields:
θ₁::Real — parameter
θ₂::Real — parameter
Constructor
AsymMixedCopula(θ₁, θ₂) ExtremeValueCopula(2, AsymMixedTail(θ₁, θ₂))
The (bivariate) asymmetric Mixed extreme-value copula is parameterized by two parameters
θ₁ ≥ 0
θ₁ + θ₂ ≤ 1
θ₁ + 2θ₂ ≤ 1
θ₁ + 3θ₂ ≥ 0
Its Pickands dependence function is
Special cases:
θ₁ = θ₂ = 0 ⇒ IndependentCopula
θ₂ = 0 ⇒ symmetric Mixed copula
References:
- [49] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
BC2Tail
Copulas.BC2Tail Type
BC2Tail{T}, BC2Copula{T}Fields:
a::Real — parameter (a ∈ [0,1])
b::Real — parameter (b ∈ [0,1])
Constructor
BC2Copula(a, b)
ExtremeValueCopula(2, BC2Tail(a, b))The bivariate BC2 extreme-value copula is parameterized by two parameters
References:
- [50] Mai, J. F., & Scherer, M. (2011). Bivariate extreme-value copulas with discrete Pickands dependence measure. Extremes, 14, 311-324. Springer, 2011.
CuadrasAugeTail
Copulas.CuadrasAugeTail Type
CuadrasAugeTail{T}, CuadrasAugeCopula{T}Fields:
- θ::Real — dependence parameter, θ ∈ [0,1]
Constructor
CuadrasAugeCopula(θ)
ExtremeValueCopula(2, CuadrasAugeTail(θ))The (bivariate) Cuadras-Augé extreme-value copula is parameterized by
Special cases:
θ = 0 ⇒ IndependentCopula
θ = 1 ⇒ MCopula (comonotone copula)
References:
- [51] Mai, J. F., & Scherer, M. (2012). Simulating copulas: stochastic models, sampling algorithms, and applications (Vol. 4). World Scientific.
GalambosTail
Copulas.GalambosTail Type
GalambosTail{T}, GalambosCopula{T}Fields:
- θ::Real — dependence parameter, θ ≥ 0
Constructor
GalambosCopula(θ)
ExtremeValueCopula(2, GalambosTail(θ))The (bivariate) Galambos extreme-value copula is parameterized by
Special cases:
θ = 0 ⇒ IndependentCopula
θ = ∞ ⇒ MCopula (upper Fréchet-Hoeffding bound)
References:
- [52] Galambos, J. (1975). Order statistics of samples from multivariate distributions. Journal of the American Statistical Association, 70(351a), 674-680.
HuslerReissTail
Copulas.HuslerReissTail Type
HuslerReissTail{T}, HuslerReissCopula{T}Fields:
- θ::Real — dependence parameter, θ ≥ 0
Constructor
HuslerReissCopula(θ)
ExtremeValueCopula(2, HuslerReissTail(θ))The (bivariate) Hüsler-Reiss extreme-value copula is parameterized by
where
Special cases:
θ = 0 ⇒ IndependentCopula
θ = ∞ ⇒ MCopula (upper Fréchet-Hoeffding bound)
References:
- [53] Hüsler, J., & Reiss, R. D. (1989). Maxima of normal random vectors: between independence and complete dependence. Statistics & Probability Letters, 7(4), 283-286.
LogTail
Copulas.LogTail Type
LogTail{T}, LogCopula{T}Fields:
- θ::Real — dependence parameter, θ ∈ [0,1]
Constructor
LogCopula(θ)
ExtremeValueCopula(2, LogTail(θ))The (bivariate) Mixed extreme-value copula is parameterized by
Special cases:
- θ = 0 ⇒ IndependentCopula
References:
- [49] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
MixedTail
Copulas.MixedTail Type
MixedTail{T}, MixedCopula{T}Fields:
- θ::Real — dependence parameter, θ ∈ [0,1]
Constructor
MixedCopula(θ)
ExtremeValueCopula(2, MixedTail(θ))The (bivariate) Mixed extreme-value copula is parameterized by
Special cases:
- θ = 0 ⇒ IndependentCopula
References:
- [49] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
MOTail
Copulas.MOTail Type
MOTail{T}, MOCopula{T}Fields:
λ₁::Real — parameter ≥ 0
λ₂::Real — parameter ≥ 0
λ₁₂::Real — parameter ≥ 0
Constructor
MOCopula(λ₁, λ₂, λ₁₂)
ExtremeValueCopula(2, MOTail(λ₁, λ₂, λ₁₂))The (bivariate) Marshall-Olkin extreme-value copula is parameterized by
Special cases:
If λ₁₂ = 0, reduces to an asymmetric independence-like form.
If λ₁ = λ₂ = 0, degenerates to complete dependence.
References:
- [51] Mai, J. F., & Scherer, M. (2012). Simulating copulas: stochastic models, sampling algorithms, and applications (Vol. 4). World Scientific.
tEVTail
Copulas.tEVTail Type
tEVTail{Tdf,Tρ}, tEVCopula{T}Fields:
ν::Real — degrees of freedom (ν > 0)
ρ::Real — correlation parameter (ρ ∈ (-1,1])
Constructor
tEVCopula(ν, ρ)
ExtremeValueCopula(2, tEVTail(ν, ρ))The (bivariate) extreme-t copula is parameterized by
Where
Special cases:
ρ = 0 ⇒ IndependentCopula
ρ = 1 ⇒ M Copula (upper Fréchet-Hoeffding bound)
References:
- [54] Nikoloulopoulos, A. K., Joe, H., & Li, H. (2009). Extreme value properties of multivariate t copulas. Extremes, 12, 129-148.
EmpiricalEVTail
Copulas.EmpiricalEVTail Type
EmpiricalEVTail, EmpiricalEVCopulaFields:
tgrid::Vector{Float64}— evaluation grid in (0,1)Ahat::Vector{Float64}— estimated Pickands function values ontgridslope::Vector{Float64}— per-segment slopes for linear interpolation
Constructor
EmpiricalEVTail(u; method=:ols, grid=401, eps=1e-3, pseudo_values=true) ExtremeValueCopula(2, EmpiricalEVTail(u; ...))
The empirical extreme-value (EV) copula (bivariate) is defined from pseudo-observations u = (U₁, U₂) and a nonparametric estimator of the Pickands dependence function. Supported estimators are:
:pickands— classical Pickands estimator:cfg— Capéraà–Fougères–Genest (CFG) estimator:ols— OLS-intercept estimator
For stability, the estimated function is always projected onto the class of valid Pickands functions (convex, bounded between max(t,1-t) and 1, with endpoints fixed at 1).
Its Pickands function is
Â(t), t ∈ (0,1),evaluated via piecewise linear interpolation on the grid tgrid.
References
[caperaa1997nonparametric] Capéraà, Fougères, Genest (1997) Biometrika
[gudendorf2011nonparametric] Gudendorf, Segers (2011) Journal of Multivariate Analysis
References
H. Joe. Dependence Modeling with Copulas (CRC press, 2014).
G. Gudendorf and J. Segers. Extreme-value copulas. In: Copula Theory and Its Applications: Proceedings of the Workshop Held in Warsaw, 25-26 September 2009 (Springer, 2010); pp. 127–145.
K. Ghoudi, A. Khoudraji and E. L.-P. Rivest. Propriétés statistiques des copules de valeurs extrêmes bidimensionnelles. Canadian Journal of Statistics 26, 187–197 (1998).
P. Deheuvels. On the limiting behavior of the Pickands estimator for bivariate extreme-value distributions. Statistics & Probability Letters 12, 429–439 (1991).
J.-F. Mai and M. Scherer. Financial engineering with copulas explained (Springer, 2014).
H. Joe. Families of min-stable multivariate exponential and multivariate extreme value distributions. Statistics & probability letters 9, 75–81 (1990).
J. A. Tawn. Bivariate extreme value theory: models and estimation. Biometrika 75, 397–415 (1988).
J.-F. Mai and M. Scherer. Bivariate extreme-value copulas with discrete Pickands dependence measure. Extremes 14, 311–324 (2011).
J.-F. Mai and M. Scherer. Simulating copulas: stochastic models, sampling algorithms, and applications. Vol. 4 (World Scientific, 2012).
J. Galambos. Order statistics of samples from multivariate distributions. Journal of the American Statistical Association 70, 674–680 (1975).
J. Hüsler and R.-D. Reiss. Maxima of normal random vectors: between independence and complete dependence. Statistics & Probability Letters 7, 283–286 (1989).
A. K. Nikoloulopoulos, H. Joe and H. Li. Extreme value properties of multivariate t copulas. Extremes 12, 129–148 (2009).