Skip to content

Public API

This page documents the stable public names exported by VineCopulas.jl.

Core types

VineCopulas.AbstractVineCopula Type
julia
AbstractVineCopula{p} <: Copulas.Copula{p}

Abstract supertype for all p-dimensional vine copula models implemented by VineCopulas.jl. Concrete subtypes include CVineCopula, DVineCopula, and RVineCopula.

source
VineCopulas.VineCopula Type
julia
VineCopula

Alias for AbstractVineCopula.

source
VineCopulas.PairCopula Type
julia
PairCopula

Alias for Copulas.Copula{2}. Pair-copulas are the bivariate building blocks used on vine edges.

source
VineCopulas.CVineCopula Type
julia
CVineCopula(order, edges; trunc=length(order)-1)

Construct a canonical vine copula from a variable order and a triangular collection of bivariate pair-copulas. The entry edges[k][i] represents the pair-copula between the root order[k] and the child order[k+i], conditional on the previous roots order[1:k-1].

Matrices of observations follow the package convention p × n: rows are dimensions and columns are observations.

Example

julia
C12 = GaussianCopula([1.0 0.5; 0.5 1.0])
C13 = ClaytonCopula(2, 2.0)
C23_1 = FrankCopula(2, 3.0)
cv = CVineCopula([1, 2, 3], [[C12, C13], [C23_1]])
source
VineCopulas.DVineCopula Type
julia
DVineCopula(order, edges; trunc=length(order)-1)

Construct a drawable/path vine copula from a variable order and a triangular collection of bivariate pair-copulas. The entry edges[k][i] represents the pair-copula between order[i] and order[i+k], conditional on the variables between them in the D-vine path.

Example

julia
C12 = GaussianCopula([1.0 0.5; 0.5 1.0])
C23 = ClaytonCopula(2, 2.0)
C13_2 = FrankCopula(2, 3.0)
dv = DVineCopula([1, 2, 3], [[C12, C23], [C13_2]])
source
VineCopulas.RVineCopula Type
julia
RVineCopula(order, struct_array, edges; trunc=length(order)-1)
RVineCopula(matrix, edges)

Construct a regular-vine copula from an explicit structure array or from an R-vine matrix exchange representation. General R-vine support in v0.1 is more experimental than the C-vine and D-vine engines.

source
VineCopulas.RVineStructure Type
julia
RVineStructure(order, struct_array; trunc=length(order)-1)

Internal representation of a regular-vine structure. It stores the variable order, triangular structure array, optional exchange matrix, and truncation level.

source
VineCopulas.VineEdge Type
julia
VineEdge

Description of a pair-copula edge in a vine tree, including the conditioned variables, conditioning set, pair-copula, tree level, and within-tree index.

source

Structure accessors

VineCopulas.order Function
julia
order(vine)

Return the variable order used by a vine copula.

source
julia
order(vine)

Return the variable order used by a vine copula.

source

Return the variable order used by an RVineCopula.

source
VineCopulas.edges Function
julia
edges(vine)

Return the triangular array of bivariate pair-copulas used by a vine copula. Tree k is stored in edges(vine)[k].

source
julia
edges(vine)

Return the triangular array of bivariate pair-copulas used by a vine copula. Tree k is stored in edges(vine)[k].

source

Return the triangular array of pair-copulas used by an RVineCopula.

source
VineCopulas.struct_array Function
julia
struct_array(vine)

Return the triangular structure array used by an RVineCopula.

source
VineCopulas.truncation Function
julia
truncation(vine)

Return the number of active trees in the vine. A full p-dimensional vine has truncation level p - 1.

source
julia
truncation(vine)

Return the number of active trees in the vine. A full p-dimensional vine has truncation level p - 1.

source

Return the number of active trees in an RVineCopula.

source
VineCopulas.rvine_matrix Function
julia
rvine_matrix(vc::RVineCopula)

Return an integer matrix representation of an RVineCopula. If the object was constructed from a matrix, a copy of that original matrix is returned; otherwise one is built from the stored structure array and order.

source

Pair-copula conditionals

VineCopulas.hfunc1 Function
julia
hfunc1(C, u, v)
hfunc1(C, U)

Compute   for a bivariate pair-copula C. For an n × 2 matrix U, return one value per row.

source
VineCopulas.hfunc2 Function
julia
hfunc2(C, u, v)
hfunc2(C, U)

Compute   for a bivariate pair-copula C. For an n × 2 matrix U, return one value per row.

source
VineCopulas.hinv1 Function
julia
hinv1(C, q, v)

Invert hfunc1 in its first coordinate: return u such that hfunc1(C, u, v) ≈ q. Singular copulas may use a generalized inverse.

source
VineCopulas.hinv2 Function
julia
hinv2(C, q, u)

Invert hfunc2 in its second coordinate: return v such that hfunc2(C, u, v) ≈ q. Singular copulas may use a generalized inverse.

source
VineCopulas.h₁ Function

Unicode alias for hfunc1.

source
VineCopulas.h₂ Function

Unicode alias for hfunc2.

source
VineCopulas.h₁⁻¹ Function

Unicode alias for hinv1.

source
VineCopulas.h₂⁻¹ Function

Unicode alias for hinv2.

source

Simulation and transforms

VineCopulas.simulate_qmc Function
julia
simulate_qmc(vine, N; randomized=true)

Generate N quasi-Monte Carlo observations from a vine copula using Sobol points followed by the inverse Rosenblatt transform. The returned matrix has size p × N, with rows corresponding to variables and columns to observations.

source
VineCopulas.set_cdf_nsamples! Function
julia
set_cdf_nsamples!(N::Integer)

Set the global number of Monte Carlo or quasi-Monte Carlo samples used by the numerical cdf approximation for vine copulas. This does not affect pdf, logpdf, rand, or Rosenblatt transforms.

source
VineCopulas.enable_deterministic_cdf! Function
julia
enable_deterministic_cdf!(Npow::Integer=15)

Use 2^Npow quasi-Monte Carlo points for the numerical cdf approximation. This helper is intended for reproducible examples and tests.

source
Copulas.rosenblatt Function
julia
rosenblatt(vine, u)
rosenblatt(vine, U)

Compute the Rosenblatt transform of a point or matrix under a vine copula. A matrix input is interpreted as p × n: rows are dimensions and columns are observations. The output has the same shape as the input.

source
VineCopulas.rosenblatt! Function
julia
rosenblatt!(out, vine, U)

In-place Rosenblatt transform. out and U must have the same p × n shape.

source
Copulas.inverse_rosenblatt Function
julia
inverse_rosenblatt(vine, z)
inverse_rosenblatt(vine, Z)

Apply the inverse Rosenblatt transform. This maps independent uniforms on the unit hypercube into observations from the vine copula. Matrix inputs and outputs use the p × n convention.

source
VineCopulas.inverse_rosenblatt! Function
julia
inverse_rosenblatt!(out, vine, Z)

In-place inverse Rosenblatt transform. out and Z must have the same p × n shape.

source

Model summaries

VineCopulas.loglikelihood Function
julia
loglikelihood(vine, u)
loglikelihood(vine, U)

Return the log-density at a single point or the summed log-likelihood over a p × n matrix of observations.

source
VineCopulas.npars Function
julia
npars(C)
npars(vine)

Return a lightweight structural parameter count. For pair-copulas this uses Distributions.params when available. For vines it sums over all active edges.

source
VineCopulas.aic Function
julia
aic(vine, U)

Compute Akaike's information criterion for an explicit vine and a p × n data matrix on the copula scale.

source
VineCopulas.bic Function
julia
bic(vine, U)

Compute the classical Bayesian information criterion for an explicit vine and a p × n data matrix on the copula scale.

source