Internal API (for reference)
These are non-public implementation details. They can change without notice. Use at your own risk.
Copulas.AMHGenerator Type
AMHGenerator{T}, AMHCopula{d, T}Fields:
- θ::Real - parameter
Constructors:
AMHGenerator(θ) # Constructs the generator.
AMHCopula(d,θ) # Construct the copulaThe AMH Copula in dimension d is parameterized by θ ∈ [-1,1). It is an Archimedean copula with generator:
Special cases:
- When θ = 0, it collapses to independence.
References:
- [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
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.
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.
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.
Copulas.BB10Generator Type
BB10Generator{T}, BB10Copula{d, T}Fields:
θ::Real - parameter
δ::Real - parameter
Constructor
BB10Generator(θ, δ)
BB10Copula(d, θ, δ)The BB10 copula has parameters
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.206-207
Copulas.BB1Generator Type
BB1Generator{T}, BB1Copula{d, T}Fields:
θ::Real - parameter
δ::Real - parameter
Constructor
BB1Generator(θ, δ)
BB1Copula(d, θ, δ)The BB1 copula is parameterized by
Special cases:
- When δ = 1, it is the ClaytonCopula with parameter
.
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.190-192
Copulas.BB2Generator Type
BB2Generator{T}, BB2Copula{d, T}Fields:
θ::Real - parameter
δ::Real - parameter
Constructor
BB2Generator(θ, δ)
BB2Copula(d, θ, δ)The BB2 copula has parameters
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.193-194
Copulas.BB3Generator Type
BB3Generator{T}, BB3Copula{d, T}Fields:
θ::Real - parameter
δ::Real - parameter
Constructor
BB3Generator(θ, δ)
BB3Copula(d, θ, δ)The BB3 copula has parameters
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.195-196
Copulas.BB6Generator Type
BB6Generator{T}, BB6Copula{d, T}Fields:
θ::Real - parameter
δ::Real - parameter
Constructor
BB6Generator(θ, δ)
BB6Copula(d, θ, δ)The BB6 copula has parameters
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.200-201
Copulas.BB7Generator Type
BB7Generator{T}, BB7Copula{d, T}Fields:
θ::Real - parameter
δ::Real - parameter
Constructor
BB7Generator(θ, δ)
BB7Copula(d, θ, δ)The BB7 copula is parameterized by
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.202-203
Copulas.BB8Generator Type
BB8Generator{T}, BB8Copula{d, T}Fields:
ϑ::Real - parameter
δ::Real - parameter
Constructor
BB8Generator(ϑ, δ)
BB8Copula(d, ϑ, δ)The BB8 copula has parameters
where
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.204-205
Copulas.BB9Generator Type
BB9Generator{T}, BB9Copula{d, T}Fields:
ϑ::Real - parameter
δ::Real - parameter
Constructor
BB9Generator(ϑ, δ)
BB9Copula(d, ϑ, δ)The BB9 copula has parameters
References:
- [4] Joe, H. (2014). Dependence modeling with copulas. CRC press, Page.205-206
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.
Copulas.ClaytonGenerator Type
ClaytonGenerator{T}, ClaytonCopula{d, T}Fields:
- θ::Real - parameter
Constructor
ClaytonGenerator(θ)
ClaytonCopula(d, θ)The Clayton copula in dimension
with the continuous extension
Special cases (for the copula in dimension
When
, it is the WCopula (Lower Fréchet–Hoeffding bound) When
, 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.
Copulas.ConditionalCopula Type
ConditionalCopula{d} <: Copula{d}Copula of the conditioned random vector U_I | U_J = u_J.
sourceCopulas.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.
Copulas.DistortedDist Type
DistortedDist{Disto,Distrib} <: Distributions.UnivariateDistributionPush-forward of a base marginal by a Distortion.
Copulas.Distortion Type
Distortion <: Distributions.ContinuousUnivariateDistributionAbstract 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.
Copulas.DistortionFromCop Type
DistortionFromCop{TC,p,T} <: DistortionGeneric, 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 typep: 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 indexigivenU_js = ujs.
Notes
- A convenience method
DistortionFromCop(C, j::Int, uj::Real, i::Int)exists for the commonp = 1case.
Copulas.EllipticalCopula Type
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
where 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 returnsMvNormalfromDistributions.jl.U(::Type{MyCOp}), returning the constructor for the univariate marginal, usually in standardized form. For example,U(GaussianCopula)returnsNormalfromDistributions.jl.
From these two functions, the abstract type provides a fully functional copula.
Details
Recall the definition of spherical random vectors:
A random vector
For every matrix
Recall that spherical random vectors are random vectors which characteristic functions (c.f.) only depend on the norm of their arguments. Indeed, for any
We can therefore express this characteristic function as
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.
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
Copulas.EmpiricalEVTail Method
EmpiricalEVTail(u; kwargs...)Construct the empirical Pickands tail from data (2×N).
sourceCopulas.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.
Copulas.FrailtyGenerator Type
FrailtyGenerator<:AbstractFrailtyGenerator<:Generatormethods: - frailty(::FrailtyGenerator) gives the frailty - ϕ and the rest of generators are automatically defined from the frailty.
Constructor
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:
https://www.uni-ulm.de/fileadmin/website_uni_ulm/mawi.inst.zawa/forschung/2009-08-16_hofert.pdf
References:
- [43] M. Hoffert (2009). Efficiently sampling Archimedean copulas
Copulas.FrankGenerator Type
FrankGenerator{T}, FrankCopula{d, T}Fields:
- θ::Real - parameter
Constructor
FrankGenerator(θ)
FrankCopula(d,θ)The Frank copula in dimension
Special cases:
When
, it is the WCopula (Lower Fréchet–Hoeffding bound) When
, 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.
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.
Copulas.Generator Type
GeneratorAbstract type. Implements the API for archimedean generators.
An Archimedean generator is simply a function
To generate an archimedean copula in dimension
is times derivable. and if is a non-increasing and convex function.
The access to the function
ϕ(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
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.𝒲₋₁(G::Generator, d::Int)gives the Wiliamson d-transform of the generator as a univaraite positive dsitribution.
References:
- [14] McNeil, A. J., & Nešlehová, J. (2009). Multivariate Archimedean copulas, d-monotone functions and ℓ 1-norm symmetric distributions.
Copulas.GumbelBarnettGenerator Type
GumbelBarnettGenerator{T}, GumbelBarnettCopula{d, T}Fields:
- θ::Real - parameter
Constructor
GumbelBarnettGenerator(θ)
GumbelBarnettCopula(d,θ)The Gumbel-Barnett copula is an archimdean copula with generator:
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.
Copulas.GumbelGenerator Type
GumbelGenerator{T}, GumbelCopula{d, T}Fields:
- θ::Real - parameter
Constructor
GumbelGenerator(θ)
GumbelCopula(d,θ)The Gumbel copula in dimension
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.
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.
Copulas.InvGaussianGenerator Type
InvGaussianGenerator{T}, InvGaussianCopula{d, T}Fields:
- θ::Real - parameter
Constructor
InvGaussianGenerator(θ)
InvGaussianCopula(d,θ)The Inverse Gaussian copula in dimension
More details about Inverse Gaussian Archimedean copula are found in :
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.
Copulas.JoeGenerator Type
JoeGenerator{T}, JoeCopula{d, T}Fields:
- θ::Real - parameter
Constructor
JoeGenerator(θ)
JoeCopula(d,θ)The Joe copula in dimension
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.
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.
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.
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.
Copulas.NoTail Type
NoTailCorresponds to the case where the pickads function is identically One, which means no particular tail behavior.
sourceCopulas.SubsetCopula Type
SubsetCopula{d,CT}Fields:
C::CT- The copuladims::Tuple{Int}- a Tuple representing which dimensions are used.
Constructor
SubsetCopula(C::Copula,dims)This class allows to construct a random vector corresponding to a few dimensions of the starting copula. If C, this returns the copula of ( for i in dims). The dependence structure is preserved. There are specialized methods for some copulas.
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.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.
Copulas.𝒲₋₁ Type
𝒲₋₁(G::Generator, d::Int)Computes the inverse Williamson d-transform of the d-monotone archimedean generator ϕ, represented by G::Generator.
A
and is times derivable, and the signs of its derivatives alternates : . is convex.
For such a function
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.
sourceCopulas._available_fitting_methods Method
_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
_available_fitting_methods(GumbelCopula, 3)
# → (:mle, :itau, :irho, :ibeta)Copulas._copula_of Method
_copula_of(M::CopulaModel)Returns the copula object contained in the model, even if the result is a SklarDist.
Copulas._fit Method
_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×npseudo-observations (ifpseudo_values=true) or raw data.m: integer (same degree in all coordinates), tuple of degrees per dimension,
or nothing for automatic selection.
pseudo_values: iffalse, pseudo-observations are constructed withpseudos(U).kwargs...: forwarded to theBernsteinCopulaconstructor.
Returns
(C, meta)whereC::BernsteinCopulaand
meta = (; emp_kind = :bernstein, pseudo_values, m = C.m).
Note: Method with no free parameters (dof=0).
Copulas._fit Method
_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×nmatrix of pseudo-observations in[0,1].kwargs...: Arguments passed back to theBetaCopulaconstructor.
Returns
(C, meta)whereC::BetaCopulaandmeta = (; emp_kind = :beta).
Note: Method with no free parameters (dof=0).
Copulas._fit Method
_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×npseudo-observations (or raw data ifpseudo_values=false).m: integer or vector of integers (one per dimension), ornothingfor the default case.pseudo_values: iffalse, internal pseudo-observations are applied.kwargs...: forwarded to the constructor.
Returns
(C, meta)whereC::CheckerboardCopulaand
meta = (; emp_kind = :exact, pseudo_values, m = C.m).
Note: Method without free parameters (dof=0).
Copulas._fit Method
_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:
copulais the fitted copula instance,meta::NamedTupleholds method–specific metadata to be stored inmethod_details.
This is not intended for direct use by end–users. Use [Distributions.fit(CopulaModel, ...)] instead.
Copulas._fit Method
_fit(::Type{<:EmpiricalCopula}, U, ::Val{:deheuvels};
pseudo_values::Bool=true, kwargs...) -> (C, meta)Constructs the empirical Deheuvels copula from U.
Arguments
U::AbstractMatrix:d×npseudo-observations ifpseudo_values=true; otherwise, they are computed internally withpseudo(U).kwargs...: forwarded to theEmpiricalCopulaconstructor.
Returns
(C, meta)whereC::EmpiricalCopulaand
meta = (; emp_kind = :deheuvels, pseudo_values).
Note: Method with no free parameters (dof=0).
Copulas._fit Method
_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. Ifpseudo_values=false, pseudo-observations are applied.method: estimator of the Pickands function (:ols/:cfg/:pickands).grid: number of grid points int∈(ε,1−ε).eps: extreme trimming for numerical stability.kwargs...: forwarded toEmpiricalEVTail/EmpiricalEVCopula.
Returns
(C, meta)whereC::EmpiricalEVCopulaand
meta = (; emp_kind = :ev_tail, pseudo_values, method = :ols|:cfg|:pickands, grid, eps).
Note: Method with no free parameters (dof=0).
Copulas._kendall_sample Method
_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
uis expected as ad×nmatrix (columns are observations). This routine first applies per-margin ordinal ranks (same policy aspseudos) 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 lengthnwith values in(0,1).
Copulas._print_dependence_metrics Method
Print dependence metrics if available/supported by the copula C.
sourceCopulas._print_marginals_section Method
Print the Marginals section for a SklarDist using precomputed Vm if available.
sourceCopulas._print_param_section Method
Print a standardized parameter section with optional covariance matrix and vcov method note.
sourceCopulas._section Method
Render a section header with optional suffix, surrounded by horizontal rules.
sourceCopulas.taylor Method
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
Copulas.ϕ Method
Generic fallback for ϕ on WilliamsonGenerator (non-discrete-nonparametric TX). Specializations for TX<:DiscreteNonParametric are provided below.
StatsAPI.aic Method
aic(M::CopulaModel) -> Float64Akaike information criterion for the fitted model.
sourceStatsAPI.bic Method
bic(M::CopulaModel) -> Float64Bayesian information criterion for the fitted model.
sourceStatsAPI.coef Method
coef(M::CopulaModel) -> Vector{Float64}Vector with the estimated parameters of the copula.
sourceStatsAPI.coefnames Method
coefnames(M::CopulaModel) -> Vector
Names of the estimated copula parameters.
sourceStatsAPI.deviance Method
deviance(M::CopulaModel) -> Float64Deviation of the fitted model (-2 * loglikelihood).
sourceStatsAPI.fit Method
Distributions.fit(CT::Type{<:Copula}, U; kwargs...) -> CTQuick fit: devuelve solo la cópula ajustada (atajo de Distributions.fit(CopulaModel, CT, U; kwargs...)).
StatsAPI.fit Method
fit(CopulaModel, CT::Type{<:Copula}, U; method=:default, kwargs...)Fit a copula of type CT to pseudo-observations U.
Arguments
U::AbstractMatrix— ad×nmatrix of data (each column is an observation). If the input is raw data, useSklarDistfitting 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=401for extreme-value tails, etc.).
Returns
A CopulaModel containing the fitted copula and metadata.
Examples
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)StatsAPI.fit Method
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.
StatsAPI.nobs Method
nobs(M::CopulaModel) -> IntNumber of observations used in the model fit.
sourceStatsAPI.params Method
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.
StatsAPI.predict Method
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=:cdfor:pdf).what— one of:cdf,:pdf, or:simulate.nsim— number of samples to simulate ifwhat=:simulate.
Returns
- Vector or matrix of predicted probabilities/densities, or simulated samples.
StatsAPI.residuals Method
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.
sourceStatsAPI.vcov Method
vcov(M::CopulaModel) -> Union{Nothing, Matrix{Float64}}Variance and covariance matrix of the estimators. Can be nothing if not available.
References
R. B. Nelsen. An Introduction to Copulas. 2nd ed Edition, Springer Series in Statistics (Springer, New York, 2006).
H. Joe. Dependence Modeling with Copulas (CRC press, 2014).
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).
M. Hofert. Efficiently sampling Archimedean copulas (2009).
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.
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).