Skip to main content

VineCopulas

github repo badge github license badge Documentation Status PyPI version

VineCopulas is a Python package that is able to:

  • Fit both bivariate and vine copulas
  • Simulate from both bivariate and vine copulas
  • Allow for both discrete as well as continuous input data
  • Draw conditional samples for any variables of interest with the use of bivariate copulas and different vine structures

Installation

pip install vinecopulas

Getting Started

Get started by testing checking out the package functionality using the Abalone example data.

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from vinecopulas.marginals import *
from vinecopulas.bivariate import *

datapath = 'https://raw.githubusercontent.com/VU-IVM/vinecopula/develop/doc/sample_data.csv'
df = pd.read_csv(datapath)
df.head()

Transform the data to pseudo data and fit a survival gumbel copula between two variables. Use the fitted copula to generate random samples.

x = np.array(df)[:,:-1]
u =  pseudodata(x) # computes the pseudodata
cop = 4 # copula 4 is the gumbel copula with 180 degree rotation
par = fit(cop, u[:,:2]) # fit the variables in the first 2 columns 
n = len(u) # number of samples to generate 
ur = random(cop, par, n) # generate random samples
# plot
plt.scatter(u[:,0],u[:,1], label = 'Data')
plt.scatter(ur[:,0], ur[:,1], alpha = 0.5, label = 'Random')
plt.xlabel('$u_1$')
plt.ylabel('$u_2$')
plt.legend()

Fit a vine copula between multiple variables in the data, considering all possible copulas available in the package.

cops = list(range(1,16)) # fit vine copula according to these copulas
M, P, C = fit_vinecop(u, cops, vine = 'R') # fit R-vine
plotvine(M,variables = list(df.columns[:-1]), plottitle = 'R-Vine') # plot structure

For more examples, please have a look at the documentation.

Contribution Guidelines


Please look at our Contributing Guidelines if you are interested in contributing to this package.

Asking Questions and Reporting Issues


If you encounter any bugs or issues while using VineCopulas, please report them by opening an issue in the GitHub repository. Be sure to provide detailed information about the problem, such as steps to reproduce it, including operating system and Python version.

If you have any suggestions for improvements, or questions, please also raise an issue.

Citing the Package


If you use the VineCopulas package in your work, please cite:

Claassen, J. N., Koks, E. E., de Ruiter, M. C., Ward, P. J., & Jäger, W. S. (2024). VineCopulas: an open-source Python package for vine copula modelling. Journal of Open Source Software, 9(101), 6728. https://doi.org/10.21105/joss.06728

Metadata

Release files for VineCopulas 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for VineCopulas 2.0.3
File Size Uploaded Provenance Actions
vinecopulas-2.0.3.tar.gz 51.3 kB With provenance Details for vinecopulas-2.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for VineCopulas 2.0.3
File Interpreter ABI Platform Actions
vinecopulas-2.0.3-py3-none-any.whl Python 3 none any Details for vinecopulas-2.0.3-py3-none-any.whl

Total release size: 96.6 kB

Release files / vinecopulas-2.0.3.tar.gz

Download URL vinecopulas-2.0.3.tar.gz
Size 51.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63214d6279ae4c26809598b22da7ca096a8539856f6865bb14d56eedb23dfa21
BLAKE2b-256 checksum
How to use checksums
8906e59a2a774e56f1374d151da168f42fb5866315f8bbd72f8844a6b91c7b54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Release files / vinecopulas-2.0.3-py3-none-any.whl

Download URL vinecopulas-2.0.3-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26f6bdf7e5f152d21210941fd34281b015166903191804199d7651dd15e6159d
BLAKE2b-256 checksum
How to use checksums
1a01d12a0cff88582947e8289005ece0697d310aca029e97ff55dbd7f977076a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Security for VineCopulas 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vinecopulas-2.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page