Skip to content

Internal API (for reference)

These are non-public implementation details. They can change without notice. Use at your own risk.

Copulas.AMHGenerator Type
julia
AMHGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
AMHGenerator(θ)
AMHCopula(d,θ)

The AMH copula in dimension d is parameterized by θ[1,1). It is an Archimedean copula with generator:

ϕ(t)=11θetθ.

Special cases:

  • When θ = 0, it is the IndependentCopula

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
Copulas.AsymGalambosTail Type
julia
AsymGalambosTail{T}

Fields:

  • α::Real — dependence parameter

  • θ₁::Real — asymmetry weight in [0,1]

  • θ₂::Real — asymmetry weight in [0,1]

Constructor

julia
AsymGalambosCopula(α, θ₁, θ₂)
ExtremeValueCopula(2, AsymGalambosTail(α, θ₁, θ₂))

The (bivariate) asymmetric Galambos extreme-value copula is parameterized by α[0,) and θ1,θ2[0,1]. It is an EV copula with Pickands function

A(t)=1((θ1t)α+(θ2(1t))α)1/α,t[0,1].

Special cases:

  • α = 0 ⇒ IndependentCopula

  • θ₁ = θ₂ = 0 ⇒ IndependentCopula

  • θ₁ = θ₂ = 1 ⇒ GalambosCopula

References:

  • [49] Families of min-stable multivariate exponential and multivariate extreme value distributions. Statist. Probab, 1990.
source
Copulas.AsymLogTail Type
julia
AsymLogTail{T}

Fields:

  • α::Real — dependence parameter (α ≥ 1)

  • θ₁::Real — asymmetry weight in [0,1]

  • θ₂::Real — asymmetry weight in [0,1]

Constructor

julia
AsymLogCopula(α, θ₁, θ₂)
ExtremeValueCopula(2, AsymLogTail(α, θ₁, θ₂))

The (bivariate) asymmetric logistic extreme–value copula is parameterized by α ∈ [1, ∞) and θ₁, θ₂ ∈ [0,1]. Its Pickands dependence function is

A(t)=(θ1α(1t)α+θ2αtα)1/α+(θ1θ2)t+1θ1,t[0,1].

Special cases:

  • θ₁ = θ₂ = 1 ⇒ symmetric Logistic (Gumbel) copula

  • θ₁ = θ₂ = 0 ⇒ independence (A(t) ≡ 1)

References:

  • [50] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
source
Copulas.AsymMixedTail Type
julia
AsymMixedTail{T}

Fields:

  • θ₁::Real — parameter

  • θ₂::Real — parameter

Constructor

AsymMixedCopula(θ₁, θ₂) ExtremeValueCopula(2, AsymMixedTail(θ₁, θ₂))

The (bivariate) asymmetric Mixed extreme-value copula is parameterized by two parameters θ1, θ2 subject to the following constraints:

  • θ₁ ≥ 0

  • θ₁ + θ₂ ≤ 1

  • θ₁ + 2θ₂ ≤ 1

  • θ₁ + 3θ₂ ≥ 0

Its Pickands dependence function is

A(t)=θ2t3+θ1t2(θ1+θ2)t+1,t[0,1].

Special cases:

  • θ₁ = θ₂ = 0 ⇒ IndependentCopula

  • θ₂ = 0 ⇒ symmetric Mixed copula

References:

  • [50] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
source
Copulas.BB10Generator Type
julia
BB10Generator{T}

Fields:

  • θ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB10Generator(θ, δ)
BB10Copula(d, θ, δ)

The BB10 copula has parameters θ(0,) and δ[0,1]. It is an Archimedean copula with generator:

ϕ(t)=(1δetδ)1/θ,

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.206-207
source
Copulas.BB1Generator Type
julia
BB1Generator{T}

Fields:

  • θ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB1Generator(θ, δ)
BB1Copula(d, θ, δ)

The BB1 copula is parameterized by θ(0,) and δ[1,). It is an Archimedean copula with generator:

ϕ(t)=(1+t1/δ)1/θ,

Special cases:

  • When δ = 1, it is the ClaytonCopula with parameter θ.

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.190-192
source
Copulas.BB2Generator Type
julia
BB2Generator{T}

Fields:

  • θ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB2Generator(θ, δ)
BB2Copula(d, θ, δ)

The BB2 copula has parameters θ,δ(0,). It is an Archimedean copula with generator:

ϕ(t)=[1+δ1log(1+t)]1θ,

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.193-194
source
Copulas.BB3Generator Type
julia
BB3Generator{T}

Fields:

  • θ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB3Generator(θ, δ)
BB3Copula(d, θ, δ)

The BB3 copula has parameters θ[1,) and δ(0,). It is an Archimedean copula with generator:

ϕ(t)=exp([δ1log(1+t)]1θ),

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.195-196
source
Copulas.BB6Generator Type
julia
BB6Generator{T}

Fields:

  • θ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB6Generator(θ, δ)
BB6Copula(d, θ, δ)

The BB6 copula has parameters θ,δ[1,). It is an Archimedean copula with generator:

ϕ(t)=1[1exp(t1δ)]1θ

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.200-201
source
Copulas.BB7Generator Type
julia
BB7Generator{T}

Fields:

  • θ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB7Generator(θ, δ)
BB7Copula(d, θ, δ)

The BB7 copula is parameterized by θ[1,) and δ(0,). It is an Archimedean copula with generator:

ϕ(t)=1[1(1+t)1/δ]1/θ.

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.202-203
source
Copulas.BB8Generator Type
julia
BB8Generator{T}

Fields:

  • ϑ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB8Generator(ϑ, δ)
BB8Copula(d, ϑ, δ)

The BB8 copula has parameters ϑ[1,) and δ(0,1]. It is an Archimedean copula with generator:

ϕ(t)=δ1[1(1ηexp(t))1ϑ],

where η=1(1δ)ϑ.

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.204-205
source
Copulas.BB9Generator Type
julia
BB9Generator{T}

Fields:

  • ϑ::Real - parameter

  • δ::Real - parameter

Constructor

julia
BB9Generator(ϑ, δ)
BB9Copula(d, ϑ, δ)

The BB9 copula has parameters ϑ[1,) and δ(0,). It is an Archimedean copula with generator:

ϕ(t)=exp((δϑ+t)1ϑ+δ1),

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.205-206
source
Copulas.BC2Tail Type
julia
BC2Tail{T}

Fields:

  • a::Real — parameter (a ∈ [0,1])

  • b::Real — parameter (b ∈ [0,1])

Constructor

julia
BC2Copula(a, b)
ExtremeValueCopula(2, BC2Tail(a, b))

The bivariate BC2 extreme-value copula is parameterized by two parameters a,b[0,1]. Its Pickands dependence function is

A(t)=max{at,b(1t)}+max{(1a)t,(1b)(1t)},t[0,1].

References:

  • [51] Mai, J. F., & Scherer, M. (2011). Bivariate extreme-value copulas with discrete Pickands dependence measure. Extremes, 14, 311-324. Springer, 2011.
source
Copulas.ClaytonGenerator Type
julia
ClaytonGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
ClaytonGenerator(θ)
ClaytonCopula(d, θ)

The Clayton copula in dimension d is parameterized by θ[1/(d1),) (with the independence case as the limit θ0). It is an Archimedean copula with generator

ϕ(t)=(1+θt)1/θ

with the continuous extension ϕ(t)=et at θ=0.

Special cases (for the copula in dimension d):

  • When θ=1/(d1), it is the WCopula (Lower Fréchet–Hoeffding bound)

  • When θ0, it is the IndependentCopula

  • When θ, it is the MCopula (Upper Fréchet–Hoeffding bound)

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
Copulas.ConditionalCopula Type
julia
ConditionalCopula{d} <: Copula{d}

Copula of the conditioned random vector U_I | U_J = u_J.

source
Copulas.CuadrasAugeTail Type
julia
CuadrasAugeTail{T}

Fields:

  • θ::Real — dependence parameter, θ ∈ [0,1]

Constructor

julia
CuadrasAugeCopula(θ)
ExtremeValueCopula(2, CuadrasAugeTail(θ))

The (bivariate) Cuadras-Augé extreme-value copula is parameterized by θ[0,1]. Its Pickands dependence function is

A(t)=max{t,1t}+(1θ)min{t,1t},t[0,1].

Special cases:

  • θ = 0 ⇒ IndependentCopula

  • θ = 1 ⇒ MCopula (comonotone copula)

References:

  • [52] Mai, J. F., & Scherer, M. (2012). Simulating copulas: stochastic models, sampling algorithms, and applications (Vol. 4). World Scientific.
source
Copulas.DistortedDist Type
julia
DistortedDist{Disto,Distrib} <: Distributions.UnivariateDistribution

Push-forward of a base marginal by a Distortion.

source
Copulas.Distortion Type
julia
Distortion <: Distributions.ContinuousUnivariateDistribution

Abstract super-type for objects describing the (uniform-scale) conditional marginal transformation U_i | U_J = u_J of a copula.

Subtypes implement cdf/quantile on [0,1]. They are not full arbitrary distributions; they model how a uniform variable is distorted by conditioning. They can be applied as a function to a base marginal distribution to obtain the conditional marginal on the original scale: if D::Distortion and X::UnivariateDistribution, then D(X) is the distribution of X_i | U_J = u_J.

source
Copulas.DistortionFromCop Type
julia
DistortionFromCop{TC,p,T} <: Distortion

Generic, uniform-scale conditional marginal transformation for a copula.

This is the default fallback (based on mixed partial derivatives computed via automatic differentiation) used when a faster specialized Distortion is not available for a given copula family.

Parameters

  • TC: copula type

  • p: length of the conditioned index set J (static)

  • T: element type for the conditioned values u_J

Construction

  • DistortionFromCop(C::Copula, js::NTuple{p,Int}, ujs::NTuple{p,<:Real}, i::Int) builds the distortion for the conditional marginal of index i given U_js = ujs.

Notes

  • A convenience method DistortionFromCop(C, j::Int, uj::Real, i::Int) exists for the common p = 1 case.
source
Copulas.EllipticalCopula Type
julia
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(F11,...,Fd1),

where F and F1,...,Fd 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 X is said to be spherical if for all orthogonal matrix AOd(R), AXX.

For every matrix B and vector c, the random vector BX+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 AOd(R),

ϕ(t)=E(et,X)=E(et,AX)=E(eAt,X)=ϕ(At).

We can therefore express this characteristic function as ϕ(t)=ψ(t22), where ψ 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 At2=t2 for any orthogonal matrix 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:

julia
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
Copulas.EmpiricalEVTail Type
julia
EmpiricalEVTail

Fields:

  • tgrid::Vector{Float64} — evaluation grid in (0,1)

  • Ahat::Vector{Float64} — estimated Pickands function values on tgrid

  • slope::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

julia
Â(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

source
Copulas.EmpiricalEVTail Method
julia
EmpiricalEVTail(u; kwargs...)

Construct the empirical Pickands tail from data (2×N).

source
Copulas.ExtremeValueCopula Type
julia
ExtremeValueCopula{d, TT}

Constructor

julia
ExtremeValueCopula(d, tail::Tail)

Extreme-value copulas model tail dependence via a stable tail dependence function (STDF) or, equivalently, via a Pickands dependence function A. In any dimension d, the copula cdf is

C(u)=\xp(\ll(logu1,,logud)).

For d=2, write x=logu, y=logv, s=x+y, and t=x/s. The relation between and A is

(x,y)=sA(t),A:[0,1][1/2,1],A(0)=A(1)=1, A convex.

Usage

  • Provide any valid tail tail::Tail (which implements A and/or ) to construct the copula.

  • Sampling, cdf, and logpdf follow the standard Distributions.jl API.

Example

julia
C = ExtremeValueCopula(2, GalambosTail(θ))
U = rand(C, 1000)
logpdf.(Ref(C), eachcol(U))

References:

  • [45] 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.

  • [48] Mai, J. F., & Scherer, M. (2014). Financial engineering with copulas explained (p. 168). London: Palgrave Macmillan.

source
Copulas.FrailtyGenerator Type
julia
FrailtyGenerator<:AbstractFrailtyGenerator<:Generator

methods: - frailty(::FrailtyGenerator) gives the frailty - ϕ and the rest of generators are automatically defined from the frailty.

Constructor

julia
FrailtyGenerator(D)

A Frailty generator can be defined by a positive random variable that happens to have a mgf() function to compute its moment generating function. The generator is simply:

ϕ(t)=mgf(frailty(G),t)

https://www.uni-ulm.de/fileadmin/website_uni_ulm/mawi.inst.zawa/forschung/2009-08-16_hofert.pdf

References:

  • [44] M. Hoffert (2009). Efficiently sampling Archimedean copulas
source
Copulas.FrankGenerator Type
julia
FrankGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
FrankGenerator(θ)
FrankCopula(d,θ)

The Frank copula in dimension d is parameterized by θ(,) (with independence as the limit θ0). It is an Archimedean copula with generator

ϕ(t)=1θlog(1(1eθ)et).

Special cases:

  • When θ, it is the WCopula (Lower Fréchet–Hoeffding bound)

  • When θ0, it is the IndependentCopula

  • When θ, it is the MCopula (Upper Fréchet–Hoeffding bound)

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
Copulas.GalambosTail Type
julia
GalambosTail{T}

Fields:

  • θ::Real — dependence parameter, θ ≥ 0

Constructor

julia
GalambosCopula(θ)
ExtremeValueCopula(2, GalambosTail(θ))

The (bivariate) Galambos extreme-value copula is parameterized by θ[0,). Its Pickands dependence function is

A(t)=1(tθ+(1t)θ)1/θ,t(0,1).

Special cases:

  • θ = 0 ⇒ IndependentCopula

  • θ = ∞ ⇒ MCopula (upper Fréchet-Hoeffding bound)

References:

  • [53] Galambos, J. (1975). Order statistics of samples from multivariate distributions. Journal of the American Statistical Association, 70(351a), 674-680.
source
Copulas.Generator Type
julia
Generator

Abstract type. Implements the API for archimedean generators.

An Archimedean generator is simply a function ϕ:R+[0,1] such that ϕ(0)=1 and ϕ(+)=0.

To generate an archimedean copula in dimension d, the function also needs to be d-monotone, that is :

  • ϕ is d2 times derivable.

  • (1)kϕ(k)0k{1,..,d2}, and if (1)d2ϕ(d2) is a non-increasing and convex function.

The access to the function ϕ itself is done through the interface:

julia
ϕ(G::Generator, t)

We do not check algorithmically that the proposed generators are d-monotonous. Instead, it is up to the person implementing the generator to tell the interface how big can d be through the function

julia
max_monotony(G::MyGenerator) = # some integer, the maximum d so that the generator is d-monotonous.

More methods can be implemented for performance, althouhg there are implement defaults in the package :

  • ϕ⁻¹( G::Generator, x) gives the inverse function of the generator.

  • ϕ⁽¹⁾(G::Generator, t) gives the first derivative of the generator

  • ϕ⁽ᵏ⁾(G::Generator, k::Int, t) gives the kth derivative of the generator

  • ϕ⁻¹⁽¹⁾(G::Generator, t) gives the first derivative of the inverse generator.

  • williamson_dist(G::Generator, d::Int) gives the Wiliamson d-transform of the generator.

References:

  • [14] McNeil, A. J., & Nešlehová, J. (2009). Multivariate Archimedean copulas, d-monotone functions and ℓ 1-norm symmetric distributions.
source
Copulas.GumbelBarnettGenerator Type
julia
GumbelBarnettGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
GumbelBarnettGenerator(θ)
GumbelBarnettCopula(d,θ)

The Gumbel-Barnett copula is an archimdean copula with generator:

ϕ(t)=exp(θ1(1et)),0θ1.

Special cases:

  • When θ = 0, it is the IndependentCopula

References:

  • [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.437

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.

source
Copulas.GumbelGenerator Type
julia
GumbelGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
GumbelGenerator(θ)
GumbelCopula(d,θ)

The Gumbel copula in dimension d is parameterized by θ[1,). It is an Archimedean copula with generator :

ϕ(t)=exp(t1/θ).

It has a few special cases:

  • When θ = 1, it is the IndependentCopula

  • When θ → ∞, it is the MCopula (Upper Fréchet–Hoeffding bound)

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
Copulas.HuslerReissTail Type
julia
HuslerReissTail{T}

Fields:

  • θ::Real — dependence parameter, θ ≥ 0

Constructor

julia
HuslerReissCopula(θ)
ExtremeValueCopula(2, HuslerReissTail(θ))

The (bivariate) Hüsler-Reiss extreme-value copula is parameterized by θ[0,). Its Pickands dependence function is

A(t)=tΦ(θ1+12θlog(t1t))+(1t)Φ(θ1+12θlog(1tt))

where Φ is the standard normal cdf.

Special cases:

  • θ = 0 ⇒ IndependentCopula

  • θ = ∞ ⇒ MCopula (upper Fréchet-Hoeffding bound)

References:

  • [54] Hüsler, J., & Reiss, R. D. (1989). Maxima of normal random vectors: between independence and complete dependence. Statistics & Probability Letters, 7(4), 283-286.
source
Copulas.InvGaussianGenerator Type
julia
InvGaussianGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
InvGaussianGenerator(θ)
InvGaussianCopula(d,θ)

The Inverse Gaussian copula in dimension d is parameterized by θ[0,). It is an Archimedean copula with generator:

ϕ(t)=exp(11+2θ2tθ).

More details about Inverse Gaussian Archimedean copula are found in :

julia
Mai, Jan-Frederik, and Matthias Scherer. Simulating copulas: stochastic models, sampling algorithms, and applications. Vol. 6. # N/A, 2017. Page 74.

Special cases:

  • When θ = 0, it is the IndependentCopula

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
Copulas.JoeGenerator Type
julia
JoeGenerator{T}

Fields:

  • θ::Real - parameter

Constructor

julia
JoeGenerator(θ)
JoeCopula(d,θ)

The Joe copula in dimension d is parameterized by θ[1,). It is an Archimedean copula with generator:

ϕ(t)=1(1et)1/θ.

It has a few special cases:

  • When θ = 1, it is the IndependentCopula

  • When θ = ∞, it is the MCopula (Upper Fréchet–Hoeffding bound)

References:

  • [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
source
Copulas.LogTail Type
julia
LogTail{T}

Fields:

  • θ::Real — dependence parameter, θ ∈ [0,1]

Constructor

julia
LogCopula(θ)
ExtremeValueCopula(2, LogTail(θ))

The (bivariate) Mixed extreme-value copula is parameterized by θ[0,1]. Its Pickands dependence function is

A(t)=θt2θt+1,t[0,1].

Special cases:

  • θ = 0 ⇒ IndependentCopula

References:

  • [50] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
source
Copulas.MOTail Type
julia
MOTail{T}

Fields:

  • λ₁::Real — parameter ≥ 0

  • λ₂::Real — parameter ≥ 0

  • λ₁₂::Real — parameter ≥ 0

Constructor

julia
MOCopula(λ₁, λ₂, λ₁₂)
ExtremeValueCopula(2, MOTail(λ₁, λ₂, λ₁₂))

The (bivariate) Marshall-Olkin extreme-value copula is parameterized by λi[0,),i=1,2,{1,2} Its Pickands dependence function is

A(t)=λ1(1t)λ1+λ1,2+λ2tλ2+λ1,2+λ1,2max{1tλ1+λ1,2,tλ2+λ1,2}

Special cases:

  • If λ₁₂ = 0, reduces to an asymmetric independence-like form.

  • If λ₁ = λ₂ = 0, degenerates to complete dependence.

References:

  • [52] Mai, J. F., & Scherer, M. (2012). Simulating copulas: stochastic models, sampling algorithms, and applications (Vol. 4). World Scientific.
source
Copulas.MTail Type
julia
MTail

Corresponds to the MCopula viewed as an etreme value copula.

source
Copulas.MixedTail Type
julia
MixedTail{T}

Fields:

  • θ::Real — dependence parameter, θ ∈ [0,1]

Constructor

julia
MixedCopula(θ)
ExtremeValueCopula(2, MixedTail(θ))

The (bivariate) Mixed extreme-value copula is parameterized by θ[0,1]. Its Pickands dependence function is

A(t)=θt2θt+1,t[0,1].

Special cases:

  • θ = 0 ⇒ IndependentCopula

References:

  • [50] : Tawn, Jonathan A. "Bivariate extreme value theory: models and estimation." Biometrika 75.3 (1988): 397-415.
source
Copulas.NoTail Type
julia
NoTail

Corresponds to the case where the pickads function is identically One, which means no particular tail behavior.

source
Copulas.SubsetCopula Type
julia
SubsetCopula{d,CT}

Fields:

  • C::CT - The copula

  • dims::Tuple{Int} - a Tuple representing which dimensions are used.

Constructor

julia
SubsetCopula(C::Copula,dims)

This class allows to construct a random vector corresponding to a few dimensions of the starting copula. If (X1,...,Xn) is the random vector corresponding to the copula C, this returns the copula of ( Xi for i in dims). The dependence structure is preserved. There are specialized methods for some copulas.

source
Copulas.Tail Type
julia
Tail

Abstract type. Implements the API for stable tail dependence functions (STDFs) of extreme-value copulas in dimension d.

A STDF is a function :R+d[0,) that is 1-homogeneous ((t·x)=t·(x) for all t0), convex, and satisfies the bounds max(x1,,xd)(x)x1++xd (in particular (ei)=1).

Pickands representation. By homogeneity, for x0 let x1=x1++xd and ω=x/x1Δd1. There exists a Pickands dependence function A:Δd1[0,1] (convex, max(ωi)A(ω)1) such that (x)=x1·A(ω). For d=2, A reduces to a convex function on [0,1] with max(t,1t)A(t)1 and A(0)=A(1)=1.

Interface.

  • A(tail::Tail, ω::NTuple{d,Real}) — Pickands function on the simplex \Delta_{d-1}. (For d=2, a convenience A(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‖₁) when A is available.

We do not algorithmically verify convexity/bounds; implementers are responsible for validity.

Additional helpers (with defaults).

  • For d=2: dA, d²A via AD; stable logpdf/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

source
Copulas.tEVTail Type
julia
tEVTail{Tdf,Tρ}

Fields:

  • ν::Real — degrees of freedom (ν > 0)

  • ρ::Real — correlation parameter (ρ ∈ (-1,1])

Constructor

julia
tEVCopula(ν, ρ)
ExtremeValueCopula(2, tEVTail(ν, ρ))

The (bivariate) extreme-t copula is parameterized by ν>0 and \rho \in (-1,1]``. Its Pickands dependence function is

A(x)=xtν+1(Zx)+(1x)tν+1(Z1x)

Where tν+1 is the cumulative distribution function (CDF) of the standard t distribution with ν+1 degrees of freedom and

Zx=1+ν1ρ2((x1x)1/νρ)

Special cases:

  • ρ = 0 ⇒ IndependentCopula

  • ρ = 1 ⇒ M Copula (upper Fréchet-Hoeffding bound)

References:

  • [55] Nikoloulopoulos, A. K., Joe, H., & Li, H. (2009). Extreme value properties of multivariate t copulas. Extremes, 12, 129-148.
source
Copulas.𝒲 Type
julia
𝒲(X,d)(x)

Computes the Williamson d-transform of the random variable X, taken at point x.

For a univariate non-negative random variable X, with cumulative distribution function F and an integer d2, the Williamson-d-transform of X is the real function supported on [0,[ given by:

ϕ(t)=𝒲d(X)(t)=t(1tx)d1dF(x)=E((1tX)+d1)1t>0+(1F(0))1t<0

This function has several properties: - We have that ϕ(0)=1 and ϕ(Inf)=0 - ϕ is d2 times derivable, and the signs of its derivatives alternates : k0,...,d2,(1)kϕ(k)0. - ϕ(d2) is convex.

These properties makes this function what is called an archimedean generator, able to generate archimedean copulas in dimensions up to d.

References:

  • Williamson, R. E. (1956). Multiply monotone functions and their Laplace transforms. Duke Math. J. 23 189–207. MR0077581

  • McNeil, Alexander J., and Johanna Nešlehová. "Multivariate Archimedean copulas, d-monotone functions and ℓ 1-norm symmetric distributions." (2009): 3059-3097.

source
Copulas.𝒲₋₁ Type
julia
𝒲₋₁(ϕ,d)

Computes the inverse Williamson d-transform of the d-monotone archimedean generator ϕ.

A d-monotone archimedean generator is a function ϕ on R+ that has these three properties:

  • ϕ(0)=1 and ϕ(Inf)=0

  • ϕ is d2 times derivable, and the signs of its derivatives alternates : k0,...,d2,(1)kϕ(k)0.

  • ϕ(d2) is convex.

For such a function ϕ, the inverse Williamson-d-transform of ϕ is the cumulative distribution function F of a non-negative random variable X, defined by :

F(x)=𝒲d1(ϕ)(x)=1(x)d1ϕ+(d1)(x)k!k=0d2(x)kϕ(k)(x)k!

We return this cumulative distribution function in the form of the corresponding random variable <:Distributions.ContinuousUnivariateDistribution from Distributions.jl. You may then compute : - The cdf via Distributions.cdf - The pdf via Distributions.pdf and the logpdf via Distributions.logpdf - Samples from the distribution via rand(X,n)

References: - Williamson, R. E. (1956). Multiply monotone functions and their Laplace transforms. Duke Math. J. 23 189–207. MR0077581 - McNeil, Alexander J., and Johanna Nešlehová. "Multivariate Archimedean copulas, d-monotone functions and ℓ 1-norm symmetric distributions." (2009): 3059-3097.

source
Copulas._available_fitting_methods Method
julia
_available_fitting_methods(::Type{<:Copula}, d::Int)

Return the tuple of fitting methods available for a given copula family in a given dimension.

This is used internally by Distributions.fit to check validity of the method argument and to select a default method when method=:default.

Example

julia
_available_fitting_methods(GumbelCopula, 3)
# → (:mle, :itau, :irho, :ibeta)
source
Copulas._copula_of Method
julia
_copula_of(M::CopulaModel)

Returns the copula object contained in the model, even if the result is a SklarDist.

source
Copulas._fit Method
julia
_fit(::Type{<:BernsteinCopula}, U, ::Val{:bernstein};
     m::Union{Int,Tuple,Nothing}=nothing, pseudo_values::Bool=true, kwargs...) -> (C, meta)

Empirical plug-in fitting of BernsteinCopula based on U, using the empirical copula and (optionally) a degree m per dimension.

Arguments

  • U::AbstractMatrix: d×n pseudo-observations (if pseudo_values=true) or raw data.

  • m: integer (same degree in all coordinates), tuple of degrees per dimension,

or nothing for automatic selection.

  • pseudo_values: if false, pseudo-observations are constructed with pseudos(U).

  • kwargs...: forwarded to the BernsteinCopula constructor.

Returns

  • (C, meta) where C::BernsteinCopula and

meta = (; emp_kind = :bernstein, pseudo_values, m = C.m).

Note: Method with no free parameters (dof=0).

source
Copulas._fit Method
julia
_fit(::Type{<:BetaCopula}, U, ::Val{:beta}; kwargs...) -> (C, meta)

(Empirical) plug-in adjustment of BetaCopula to U pseudo-observations.

Constructs C = BetaCopula(U; kwargs...) and also returns a NamedTuple with metadata for printing and auditing.

Arguments

  • U::AbstractMatrix: d×n matrix of pseudo-observations in [0,1].

  • kwargs...: Arguments passed back to the BetaCopula constructor.

Returns

  • (C, meta) where C::BetaCopula and meta = (; emp_kind = :beta).

Note: Method with no free parameters (dof=0).

source
Copulas._fit Method
julia
_fit(::Type{<:CheckerboardCopula}, U, ::Val{:exact};
     m=nothing, pseudo_values::Bool=true, kwargs...) -> (C, meta)

Empirical checkerboard-type plug-in fitting based on U. If m is nothing, m = (n, …, n) is used; otherwise, it must divide by the sample size.

Arguments

  • U::AbstractMatrix: d×n pseudo-observations (or raw data if pseudo_values=false).

  • m: integer or vector of integers (one per dimension), or nothing for the default case.

  • pseudo_values: if false, internal pseudo-observations are applied.

  • kwargs...: forwarded to the constructor.

Returns

  • (C, meta) where C::CheckerboardCopula and

meta = (; emp_kind = :exact, pseudo_values, m = C.m).

Note: Method without free parameters (dof=0).

source
Copulas._fit Method
julia
_fit(::Type{<:Copula}, U, ::Val{method}; kwargs...)

Internal entry point for fitting routines.

Each copula family implements _fit methods specialized on Val{method}. They must return a pair (copula, meta) where:

  • copula is the fitted copula instance,

  • meta::NamedTuple holds method–specific metadata to be stored in method_details.

This is not intended for direct use by end–users. Use [Distributions.fit(CopulaModel, ...)] instead.

source
Copulas._fit Method
julia
_fit(::Type{<:EmpiricalCopula}, U, ::Val{:deheuvels};
     pseudo_values::Bool=true, kwargs...) -> (C, meta)

Constructs the empirical Deheuvels copula from U.

Arguments

  • U::AbstractMatrix: d×n pseudo-observations if pseudo_values=true; otherwise, they are computed internally with pseudo(U).

  • kwargs...: forwarded to the EmpiricalCopula constructor.

Returns

  • (C, meta) where C::EmpiricalCopula and

meta = (; emp_kind = :deheuvels, pseudo_values).

Note: Method with no free parameters (dof=0).

source
Copulas._fit Method
julia
_fit(::Type{<:EmpiricalEVCopula}, U, method::Union{Val{:ols}, Val{:cfg}, Val{:pickands}};
     grid::Int=401, eps::Real=1e-3, pseudo_values::Bool=true, kwargs...) -> (C, meta)

Empirical bivariate extreme value copula fitting via the Pickands function (:ols, :cfg, :pickands).

Arguments

  • U::AbstractMatrix: 2×n matrix. If pseudo_values=false, pseudo-observations are applied.

  • method: estimator of the Pickands function (:ols/:cfg/:pickands).

  • grid: number of grid points in t∈(ε,1−ε).

  • eps: extreme trimming for numerical stability.

  • kwargs...: forwarded to EmpiricalEVTail/EmpiricalEVCopula.

Returns

  • (C, meta) where C::EmpiricalEVCopula and

meta = (; emp_kind = :ev_tail, pseudo_values, method = :ols|:cfg|:pickands, grid, eps).

Note: Method with no free parameters (dof=0).

source
Copulas._hr Method

Small horizontal rule for section separation.

source
Copulas._kendall_sample Method
julia
_kendall_sample(u::AbstractMatrix)

Compute the empirical Kendall sample W with entries W[i] = C_n(U[:,i]), where C_n is the Deheuvels empirical copula built from the same u.

Input and tie handling

  • u is expected as a d×n matrix (columns are observations). This routine first applies per-margin ordinal ranks (same policy as pseudos) so that the result is invariant under strictly increasing marginal transformations and robust to ties. Consequently, _kendall_sample(u) ≡ _kendall_sample(pseudos(u)) (same tie policy).

Returns

  • Vector{Float64} of length n with values in (0,1).
source
Copulas._kv Method

Key-value aligned printing for header lines.

source
Copulas._print_dependence_metrics Method

Print dependence metrics if available/supported by the copula C.

source
Copulas._print_marginals_section Method

Print the Marginals section for a SklarDist using precomputed Vm if available.

source
Copulas._print_param_section Method

Print a standardized parameter section with optional covariance matrix and vcov method note.

source
Copulas._pstr Method

Pretty p-value formatting: show very small values as inequalities.

source
Copulas._section Method

Render a section header with optional suffix, surrounded by horizontal rules.

source
Copulas.taylor Method
julia
taylor(f::F, x₀, d::Int) where {F}

Compute the Taylor series expansion of the function f around the point x₀ up to order d, and gives you back the derivatives as a vector of length d+1. (first value is f(x₀)).

Arguments

  • f: A function to be expanded.

  • x₀: The point around which to expand the Taylor series.

  • d: The order up to which the Taylor series is computed.

Returns

A tuple with value (f(x),f(x),...,f(d)(x)).

source
StatsAPI.aic Method
julia
aic(M::CopulaModel) -> Float64

Akaike information criterion for the fitted model.

source
StatsAPI.bic Method
julia
bic(M::CopulaModel) -> Float64

Bayesian information criterion for the fitted model.

source
StatsAPI.coef Method
julia
coef(M::CopulaModel) -> Vector{Float64}

Vector with the estimated parameters of the copula.

source
StatsAPI.coefnames Method

coefnames(M::CopulaModel) -> Vector

Names of the estimated copula parameters.

source
StatsAPI.deviance Method
julia
deviance(M::CopulaModel) -> Float64

Deviation of the fitted model (-2 * loglikelihood).

source
StatsAPI.fit Method
julia
Distributions.fit(CT::Type{<:Copula}, U; kwargs...) -> CT

Quick fit: devuelve solo la cópula ajustada (atajo de Distributions.fit(CopulaModel, CT, U; kwargs...)).

source
StatsAPI.fit Method
julia
fit(CopulaModel, CT::Type{<:Copula}, U; method=:default, kwargs...)

Fit a copula of type CT to pseudo-observations U.

Arguments

  • U::AbstractMatrix — a d×n matrix of data (each column is an observation). If the input is raw data, use SklarDist fitting instead to estimate both margins and copula simultaneously.

  • method::Symbol — fitting method; defaults to the first available one (see _available_fitting_methods).

  • kwargs... — additional method-specific keyword arguments (e.g. pseudo_values=true, grid=401 for extreme-value tails, etc.).

Returns

A CopulaModel containing the fitted copula and metadata.

Examples

julia
U = rand(GumbelCopula(2, 3.0), 500)

M = fit(CopulaModel, GumbelCopula, U; method=:mle)
println(M)

# Quick fit: returns only the copula
C = fit(GumbelCopula, U; method=:itau)
source
StatsAPI.fit Method
julia
fit(CopulaModel, SklarDist{CT, TplMargins}, X; copula_method=:default, sklar_method=:default,
                                       margins_kwargs=NamedTuple(), copula_kwargs=NamedTuple())

Joint margin and copula adjustment (Sklar approach). sklar_method ∈ (:ifm, :ecdf) controls whether parametric CDFs (:ifm) or pseudo-observations (:ecdf) are used.

source
StatsAPI.nobs Method
julia
nobs(M::CopulaModel) -> Int

Number of observations used in the model fit.

source
StatsAPI.params Method
julia
Distributions.params(C::Copula)
Distributions.params(S::SklarDist)

Return the parameters of the given distribution C. Our extension gives these parameters in a named tuple format.

Arguments

  • C::Distributions.Distribution: The distribution object whose parameters are to be retrieved. Copulas.jl implements particular bindings for SklarDist and Copula objects.

Returns

  • A named tuple containing the parameters of the distribution in the order they are defined for that distribution type.
source
StatsAPI.predict Method
julia
StatsBase.predict(M::CopulaModel; newdata=nothing, what=:cdf, nsim=0)

Predict or simulate from a fitted copula model.

Keyword arguments

  • newdata — matrix of points in [0,1]^d at which to evaluate (what=:cdf or :pdf).

  • what — one of :cdf, :pdf, or :simulate.

  • nsim — number of samples to simulate if what=:simulate.

Returns

  • Vector or matrix of predicted probabilities/densities, or simulated samples.
source
StatsAPI.residuals Method
julia
StatsBase.residuals(M::CopulaModel; transform=:uniform)

Compute Rosenblatt residuals of a fitted copula model.

Arguments

  • transform = :uniform → returns Rosenblatt residuals in [0,1].

  • transform = :normal → applies Φ⁻¹ to obtain pseudo-normal residuals.

Notes

The residuals should be i.i.d. Uniform(0,1) under a correctly specified model.

source
StatsAPI.vcov Method
julia
vcov(M::CopulaModel) -> Union{Nothing, Matrix{Float64}}

Variance and covariance matrix of the estimators. Can be nothing if not available.

source

References

  1. R. B. Nelsen. An Introduction to Copulas. 2nd ed Edition, Springer Series in Statistics (Springer, New York, 2006).

  2. H. Joe. Dependence Modeling with Copulas (CRC press, 2014).

  3. A. J. McNeil and J. Nešlehová. Multivariate Archimedean Copulas, d -Monotone Functions and L1 -Norm Symmetric Distributions. The Annals of Statistics 37, 3059–3097 (2009).

  4. M. Hofert. Efficiently sampling Archimedean copulas (2009).

  5. 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.

  6. J.-F. Mai and M. Scherer. Financial engineering with copulas explained (Springer, 2014).

  7. H. Joe. Families of min-stable multivariate exponential and multivariate extreme value distributions. Statistics & probability letters 9, 75–81 (1990).

  8. J. A. Tawn. Bivariate extreme value theory: models and estimation. Biometrika 75, 397–415 (1988).

  9. J.-F. Mai and M. Scherer. Bivariate extreme-value copulas with discrete Pickands dependence measure. Extremes 14, 311–324 (2011).

  10. J.-F. Mai and M. Scherer. Simulating copulas: stochastic models, sampling algorithms, and applications. Vol. 4 (World Scientific, 2012).

  11. J. Galambos. Order statistics of samples from multivariate distributions. Journal of the American Statistical Association 70, 674–680 (1975).

  12. J. Hüsler and R.-D. Reiss. Maxima of normal random vectors: between independence and complete dependence. Statistics & Probability Letters 7, 283–286 (1989).

  13. A. K. Nikoloulopoulos, H. Joe and H. Li. Extreme value properties of multivariate t copulas. Extremes 12, 129–148 (2009).