Expand description
§copula-core
copula-core is an experimental Rust library for copula modelling,
simulation, and statistical dependence analysis.
The crate is pre-1.0. The principal elliptical and Archimedean families have the strongest test coverage; advanced constructions such as extreme-value, factor, and vine copulas should be treated as experimental until their numerical contracts are validated more thoroughly.
§Mathematical setting
For continuous marginals, Sklar’s theorem gives
F(x1, ..., xd) = C(F1(x1), ..., Fd(xd)),where C is a copula and the Fi are marginal cumulative distribution
functions.
A statistical implementation must therefore respect mathematical invariants, not merely return finite numbers. The project tests properties such as unit interval bounds, Fréchet-Hoeffding bounds, density non-negativity, and sampling range for a subset of the main families.
§Quick start
use copula_core::{ClaytonCopula, Copula};
let copula = ClaytonCopula::new(2.0)?;
let c = copula.cdf(&[0.5, 0.5])?;
assert!((0.0..=1.0).contains(&c));
let mut rng = rand::thread_rng();
let samples = copula.sample(100, &mut rng)?;
assert_eq!(samples.ncols(), 2);
§Main families
§Elliptical
§Archimedean
§Other
§Feature flags
estimationenables estimation and model-selection modules.parallelenables Rayon-backed parallel support where used.serdeenables serialization support.fullenables the optional features above together.experimentalis reserved for unstable experimental surface.
§Maturity
The immediate project priority is numerical robustness of the existing API:
parameter domains, boundary behaviour, stable likelihood evaluation, and
verified estimation. See ROADMAP.md in the repository for the current plan.
Re-exports§
pub use error::CopulaError;pub use error::Result;pub use testing::anderson_darling;pub use testing::cramer_von_mises;pub use testing::cvm_multiplier_bootstrap;pub use testing::kolmogorov_smirnov;pub use traits::FittableCopula;estimationpub use model_selection::k_fold_cv;estimationpub use traits::ArchimedeanCopula;pub use traits::Copula;pub use utils::empirical_ranks;pub use utils::kendall_tau;pub use utils::spearman_rho;pub use utils::to_pseudo_observations;pub use archimedean::AMHCopula;pub use archimedean::ClaytonCopula;pub use archimedean::FrankCopula;pub use archimedean::GumbelCopula;pub use archimedean::JoeCopula;pub use elliptical::GaussianCopula;pub use elliptical::StudentTCopula;pub use other::EmpiricalCopula;pub use other::MarshallOlkinCopula;
Modules§
- archimedean
- Archimedean copulas module.
- elliptical
- Elliptical copulas module.
- error
- Error types and handling for the copulas library.
- estimation
estimation - Parameter estimation methods for copulas.
- extreme_
value - Extreme value copulas module.
- factor
- Factor copulas module.
- model_
selection estimation - Model selection utilities such as cross-validation.
- numerical
- Numerical utilities for copula computations.
- other
- Other copula families module (placeholder).
- prelude
- Convenient imports for common copula operations.
- sampling
- Advanced sampling methods for copulas.
- testing
- Statistical testing utilities.
- traits
- Core traits that define the interface for all copula types.
- utils
- Utility functions for copula modeling and data preprocessing.
- vine
- Vine copulas module.
Constants§
- VERSION
- Library version information