Public API
This page documents the stable public names exported by VineCopulas.jl.
Core types
VineCopulas.AbstractVineCopula Type
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.
VineCopulas.PairCopula Type
PairCopulaAlias for Copulas.Copula{2}. Pair-copulas are the bivariate building blocks used on vine edges.
VineCopulas.CVineCopula Type
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
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]])VineCopulas.DVineCopula Type
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
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]])VineCopulas.RVineCopula Type
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.
sourceVineCopulas.RVineStructure Type
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.
sourceVineCopulas.VineEdge Type
VineEdgeDescription of a pair-copula edge in a vine tree, including the conditioned variables, conditioning set, pair-copula, tree level, and within-tree index.
sourceStructure accessors
VineCopulas.order Function
order(vine)Return the variable order used by a vine copula.
sourceorder(vine)Return the variable order used by a vine copula.
sourceReturn the variable order used by an RVineCopula.
VineCopulas.edges Function
edges(vine)Return the triangular array of bivariate pair-copulas used by a vine copula. Tree k is stored in edges(vine)[k].
edges(vine)Return the triangular array of bivariate pair-copulas used by a vine copula. Tree k is stored in edges(vine)[k].
Return the triangular array of pair-copulas used by an RVineCopula.
VineCopulas.struct_array Function
struct_array(vine)Return the triangular structure array used by an RVineCopula.
VineCopulas.truncation Function
truncation(vine)Return the number of active trees in the vine. A full p-dimensional vine has truncation level p - 1.
truncation(vine)Return the number of active trees in the vine. A full p-dimensional vine has truncation level p - 1.
Return the number of active trees in an RVineCopula.
VineCopulas.rvine_matrix Function
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.
Pair-copula conditionals
VineCopulas.hfunc1 Function
hfunc1(C, u, v)
hfunc1(C, U)Compute C. For an n × 2 matrix U, return one value per row.
VineCopulas.hfunc2 Function
hfunc2(C, u, v)
hfunc2(C, U)Compute C. For an n × 2 matrix U, return one value per row.
VineCopulas.hinv1 Function
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.
VineCopulas.hinv2 Function
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.
Simulation and transforms
VineCopulas.simulate_qmc Function
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.
VineCopulas.set_cdf_nsamples! Function
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.
VineCopulas.enable_deterministic_cdf! Function
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.
Copulas.rosenblatt Function
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.
VineCopulas.rosenblatt! Function
rosenblatt!(out, vine, U)In-place Rosenblatt transform. out and U must have the same p × n shape.
Copulas.inverse_rosenblatt Function
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.
VineCopulas.inverse_rosenblatt! Function
inverse_rosenblatt!(out, vine, Z)In-place inverse Rosenblatt transform. out and Z must have the same p × n shape.
Model summaries
VineCopulas.loglikelihood Function
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.
VineCopulas.npars Function
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.
VineCopulas.aic Function
aic(vine, U)Compute Akaike's information criterion for an explicit vine and a p × n data matrix on the copula scale.
VineCopulas.bic Function
bic(vine, U)Compute the classical Bayesian information criterion for an explicit vine and a p × n data matrix on the copula scale.