VineCopulas

VineCopulas: an open-source Python package for vine copula modelling - Published in JOSS (2024)

https://github.com/vu-ivm/vinecopulas

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Committers with academic emails
    2 of 3 committers (66.7%) from academic institutions
  • Institutional organization owner
    Organization vu-ivm has institutional domain (www.ivm.vu.nl)
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Mathematics Computer Science - 84% confidence
Last synced: 6 months ago · JSON representation

Repository

A pure python implementation for vine copulas

Basic Info
  • Host: GitHub
  • Owner: VU-IVM
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 73.7 MB
Statistics
  • Stars: 32
  • Watchers: 0
  • Forks: 4
  • Open Issues: 5
  • Releases: 10
Created about 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Code of conduct

README.md

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 out the package functionality using the Abalone example data.

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

datapath = 'https://raw.githubusercontent.com/VU-IVM/vinecopula/develop/doc/sampledata.csv' df = pd.readcsv(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.

```python 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('$u1$') plt.ylabel('$u2$') plt.legend() ```

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

python 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

Owner

  • Name: VU-IVM
  • Login: VU-IVM
  • Kind: organization
  • Email: s.p.vijverberg@vu.nl
  • Location: Amsterdam

VU-IVM Github page

JOSS Publication

VineCopulas: an open-source Python package for vine copula modelling
Published
September 11, 2024
Volume 9, Issue 101, Page 6728
Authors
Judith N. Claassen ORCID
Institute for Environmental Studies, Vrije Universiteit Amsterdam, Amsterdam, The Netherlands
Elco E. Koks ORCID
Institute for Environmental Studies, Vrije Universiteit Amsterdam, Amsterdam, The Netherlands
Marleen C. de Ruiter ORCID
Institute for Environmental Studies, Vrije Universiteit Amsterdam, Amsterdam, The Netherlands
Philip J. Ward ORCID
Institute for Environmental Studies, Vrije Universiteit Amsterdam, Amsterdam, The Netherlands, Deltares, Delft, The Netherlands
Wiebke S. Jäger ORCID
Institute for Environmental Studies, Vrije Universiteit Amsterdam, Amsterdam, The Netherlands
Editor
Yasmin Mzayek ORCID
Tags
copula statistics

GitHub Events

Total
  • Issues event: 2
  • Watch event: 16
  • Push event: 13
  • Pull request event: 5
  • Fork event: 2
Last Year
  • Issues event: 2
  • Watch event: 16
  • Push event: 13
  • Pull request event: 5
  • Fork event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 208
  • Total Committers: 3
  • Avg Commits per committer: 69.333
  • Development Distribution Score (DDS): 0.082
Past Year
  • Commits: 16
  • Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Claassen j****n@v****l 191
Jäger w****r@v****l 9
Elco Koks 3****K 8
Committer Domains (Top 20 + Academic)
vu.nl: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 6
  • Total pull requests: 19
  • Average time to close issues: 29 days
  • Average time to close pull requests: about 21 hours
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.05
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 3
  • Average time to close issues: 3 days
  • Average time to close pull requests: 2 minutes
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • couasnonanais (2)
  • meh2135 (2)
  • Bluerrror (1)
  • EvoLandEco (1)
  • thierrymoudiki (1)
Pull Request Authors
  • judithclaassen (21)
  • wiebkejager (3)
  • ElcoK (3)
  • meh2135 (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi
  • matplotlib *
  • numpy *
  • pandas *
  • scipy *
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • mamba-org/setup-micromamba v1 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/draft-pdf.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
doc/environment.yml pypi
environment.yml pypi