Rscopulas: High-Performance Copula Modeling
rscopulas is a Python and Rust copula library with a shared Rust core. Fit, evaluate, and sample dependence structures up to ~100× faster than R's VineCopula.
Rscopulas gives you a NumPy-first Python API and a Rust library for fitting, evaluating, and sampling copula models on pseudo-observations. The Rust core powers both interfaces, delivering up to ~100× speedup over R's copula/VineCopula stack on some workloads — without sacrificing ergonomics.
Why rscopulas is better
- Blazing fast. Up to ~100× faster than the R standard — turn overnight fits into coffee breaks.
- Every copula you need. Gaussian, Student t, Archimedean, Khoudraji, full vine families, and hierarchical models — all in one library.
- Python simplicity, Rust power. Prototype in a notebook, ship to production, never rewrite a line.
- Results you can trust. Every fit comes with the diagnostics you need to defend it, out of the box.
Python Quickstart
Install from PyPI and fit your first copula model in minutes.
Rust Quickstart
Add the crate and run the shipped examples from your workspace.
Copula Families
Explore Gaussian, Student t, Archimedean, vine, and HAC models.
API Reference
Full reference for every class, method, and parameter.
What you can do with rscopulas
Rscopulas supports the full copula workflow: transform your raw data to pseudo-observations, choose a copula family, fit to data, evaluate log-density, and draw samples.
Vine Copulas
Fit C-vine, D-vine, and R-vine models with mixed pair families.
Pair Copulas
Work with bivariate pair kernels, h-functions, and rotations.
Khoudraji Copulas
Model asymmetric dependence with Khoudraji compositions.
Hierarchical Archimedean
Build and fit nested Archimedean copula trees.
Key features
- ~100× faster log_pdf on vine workloads versus R's VineCopula
- Python and Rust — same Rust core, two idiomatic APIs
- Validated inputs — strict
(0, 1)pseudo-observation checks with clear error messages - Fit diagnostics — log-likelihood, AIC, BIC, convergence flag, and iteration count on every fit
- Optional visualization — density plots, scatter plots, and vine structure graphs via
rscopulas[viz]
Installation
uv add rscopulas
pip install rscopulas
uv add "rscopulas[viz]"