h-functions and inverse h-functions
Vine algorithms are built from conditional distribution functions of bivariate copulas. For a bivariate copula VineCopulas.jl uses the convention
The public API is:
hfunc1(C, u, v)
hfunc2(C, u, v)
hinv1(C, q, v)
hinv2(C, q, u)hinv1 solves for the first coordinate hinv2 solves for the second coordinate
Example
using VineCopulas
C = ClaytonCopula(2, 2.0)
u, v = 0.25, 0.75
q1 = hfunc1(C, u, v)
q2 = hfunc2(C, u, v)
(u, hinv1(C, q1, v), v, hinv2(C, q2, u))(0.25, 0.24999999999999997, 0.75, 0.7499999999999991)Why inverses matter
Simulation from a vine is recursive. The algorithm starts with independent uniforms and then applies inverse conditional distributions. Therefore, every pair-copula used for simulation must have reliable hinv1 and hinv2 methods.
Density evaluation only needs the pair density and the forward h-functions, but Rosenblatt inversion and random generation require the inverse h-functions.
Generic and specialized paths
The package provides a generic fallback based on automatic differentiation and safeguarded scalar root-finding. Specialized methods are implemented for families where analytic formulas or stable coordinate systems are available.
This design makes contribution straightforward: a new bivariate copula can first rely on generic fallbacks; if tests expose instability or performance issues, family-specific hfunc/hinv methods can be added.