Copulas.jl

Copulas.jl: A fully Distributions.jl-compliant copula package - Published in JOSS (2024)

https://github.com/lrnv/copulas.jl

Science Score: 100.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    1 of 13 committers (7.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

copula julia

Keywords from Contributors

pde meshing standardization interpretability eeg ecology pipelines climate-change fluxes graphics

Scientific Fields

Engineering Computer Science - 40% confidence
Last synced: 4 months ago · JSON representation ·

Repository

A fully `Distributions.jl`-compliant copula package

Basic Info
Statistics
  • Stars: 103
  • Watchers: 3
  • Forks: 10
  • Open Issues: 33
  • Releases: 31
Topics
copula julia
Created almost 4 years ago · Last pushed 4 months ago
Metadata Files
Readme License Citation

README.md

Copulas.jl

A fully `Distributions.jl`-compliant copula package

Stable Dev
Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status Aqua QA
License: MIT ColPrac: Contributor's Guide on Collaborative Practices for Community Packages Code Style: Blue

Copulas.jl brings most standard copula features into native Julia: random number generation, pdf and cdf, fitting, copula-based multivariate distributions through Sklar's theorem, etc. Since copulas are distribution functions, we fully comply with the Distributions.jl API. This allows interoperability with the broader ecosystem, based on this API, such as, e.g., Turing.jl.

Usually, people that use and work with copulas turn to R, because of the amazing package R::copula. While well-maintained and regularly updated, R::copula is a mixture of obscure, heavily optimized C code and more standard R code, which makes it a complicated code base for readability, extensibility, reliability and maintenance.

This is an attempt to provide a very light, fast, reliable and maintainable copula implementation in native Julia. One of the notable benefits of such a native implementation (among others) is the floating point type agnosticity, i.e. compatibility with BigFloat, DoubleFloats, MultiFloats, etc.

The package revolves around two main types:

  • Copula, an abstract mother type for all the copulas in the package
  • SklarDist, a distribution type that allows construction of a multivariate distribution by specifying the copula and the marginals through Sklar's theorem.

Warning: This is fairly experimental work, use with caution.

Getting started

The package is registered in Julia's General registry so you may simply install the package by running :

julia ] add Copulas

The API contains random number generation, cdf and pdf evaluation, and the fit function from Distributions.jl. A typical use case might look like this:

```julia using Copulas, Distributions, Random X₁ = Gamma(2,3) X₂ = Pareto() X₃ = LogNormal(0,1) C = ClaytonCopula(3,0.7) # A 3-variate Clayton Copula with θ = 0.7 D = SklarDist(C,(X₁,X₂,X₃)) # The final distribution

simu = rand(D,1000) # Generate a dataset

You may estimate a copula using the fit function:

D̂ = fit(SklarDist{ClaytonCopula,Tuple{Gamma,Normal,LogNormal}}, simu) ```

The list of availiable copula models is very large, check it out on our documentation !

The general implementation philosophy is for the code to follow the mathematical boundaries of the implemented concepts. For example, this is the only implementation we know (in any language) that allows for all Archimedean copulas to be sampled: we use the Williamson transformation for non-standard generators, including user-provided black-box ones.

Feature comparison

There are competing packages in Julia, such as BivariateCopulas.jl which only deals with a few models in bivariate settings but has very nice graphs, or DatagenCopulaBased.jl, which only provides sampling and does not have exactly the same models as Copulas.jl. While not fully covering out both of these package's functionality (mostly because the three projects chose different implementation paths), Copulas.jl brings, as a key feature, the compliance with the broader ecosystem. The following table provides a feature comparison between the three:

| | Copulas.jl | DatagenCopulaBased.jl | BivariateCopulas.jl | |----------------|--------------|-------------------------|-----------------------| | Distributions.jl's API | ✔️ | ❌ | ✔️ | | Fitting | ✔️ | ❌ | ❌ | | Plotting | ❌ | ❌ | ✔️ | | Available copulas | | | | | - Classic Bivariate | ✔️ | ✔️ | ✔️ | | - Classic Multivariate | ✔️ | ✔️ | ❌ | | - Archimedeans | ✔️ (All of them) | ⚠️ Selected ones | ⚠️Selected ones | | - Bivariate Extreme Value| ✔️ | ❌ | ❌ | | - Obscure Bivariate | ✔️ | ❌ | ❌ | | - Archimedean Chains | ❌ | ✔️ | ❌ |

Since our primary target is maintainability and readability of the implementation, we did not consider the efficiency and the performance of the code yet. Proper benchmarks will come in the near future.

Contributions are welcome

If you want to contribute to the package, ask a question, found a bug or simply want to chat, do not hesitate to open an issue on this repo. General guidelines on collaborative practices (colprac) are available at https://github.com/SciML/ColPrac.

Citation

Do not hesitate to star this repository to show support. If you use this package in your researches, please cite it with the following bibtex code:

bibtex @article{LavernyJimenez2024, author = {Oskar Laverny and Santiago Jimenez}, title = {Copulas.jl: A fully Distributions.jl-compliant copula package}, journal = {Journal of Open Source Software}, doi = {10.21105/joss.06189}, url = {https://doi.org/10.21105/joss.06189}, year = {2024}, publisher = {The Open Journal}, volume = {9}, number = {94}, pages = {6189} }

Owner

  • Name: Oskar Laverny
  • Login: lrnv
  • Kind: user
  • Location: Brussels
  • Company: UCLouvain

What would be the dependence structure between quality of code and quantity of coffee ?

JOSS Publication

Copulas.jl: A fully Distributions.jl-compliant copula package
Published
February 29, 2024
Volume 9, Issue 94, Page 6189
Authors
Oskar Laverny ORCID
Aix Marseille Univ, Inserm, IRD, SESSTIM, Sciences Economiques & Sociales de la Santé & Traitement de l’Information Médicale, ISSPAM, Marseille, France.
Santiago Jimenez ORCID
Federal University of Pernambuco
Editor
Øystein Sørensen ORCID
Tags
julia copula dependence statistics

Citation (CITATION.bib)

@article{Laverny2024, 
    doi = {10.21105/joss.06189}, 
    url = {https://doi.org/10.21105/joss.06189}, 
    year = {2024}, 
    publisher = {The Open Journal}, 
    volume = {9}, 
    number = {94}, 
    pages = {6189}, 
    author = {Oskar Laverny and Santiago Jimenez}, 
    title = {Copulas.jl: A fully Distributions.jl-compliant copula package}, journal = {Journal of Open Source Software}
}

GitHub Events

Total
  • Create event: 22
  • Commit comment event: 9
  • Release event: 4
  • Issues event: 15
  • Watch event: 15
  • Delete event: 10
  • Issue comment event: 75
  • Push event: 49
  • Pull request review event: 12
  • Pull request review comment event: 15
  • Pull request event: 30
  • Fork event: 1
Last Year
  • Create event: 28
  • Commit comment event: 9
  • Release event: 4
  • Issues event: 15
  • Watch event: 15
  • Delete event: 14
  • Issue comment event: 77
  • Push event: 54
  • Pull request review event: 12
  • Pull request review comment event: 15
  • Pull request event: 39
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 360
  • Total Committers: 13
  • Avg Commits per committer: 27.692
  • Development Distribution Score (DDS): 0.142
Past Year
  • Commits: 33
  • Committers: 5
  • Avg Commits per committer: 6.6
  • Development Distribution Score (DDS): 0.182
Top Committers
Name Email Commits
Oskar Laverny o****y@g****m 309
Santymax98 1****8 15
CompatHelper Julia c****y@j****g 10
dependabot[bot] 4****] 8
github-actions[bot] 4****] 5
Øystein Sørensen o****n@h****m 4
szcf-weiya s****a@g****m 2
mlkrock m****k@c****u 2
pdeffebach 2****h 1
Leandro Martínez 3****q 1
Jasper Behrensdorf j****r@b****e 1
Herb Susmann h****0@g****m 1
Dilum Aluthge d****m@a****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 90
  • Total pull requests: 245
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 9 days
  • Total issue authors: 18
  • Total pull request authors: 12
  • Average comments per issue: 1.78
  • Average comments per pull request: 1.41
  • Merged pull requests: 202
  • Bot issues: 0
  • Bot pull requests: 34
Past Year
  • Issues: 10
  • Pull requests: 65
  • Average time to close issues: 3 days
  • Average time to close pull requests: 8 days
  • Issue authors: 4
  • Pull request authors: 6
  • Average comments per issue: 0.7
  • Average comments per pull request: 1.69
  • Merged pull requests: 46
  • Bot issues: 0
  • Bot pull requests: 9
Top Authors
Issue Authors
  • lrnv (64)
  • Santymax98 (7)
  • rand5 (3)
  • osorensen (2)
  • droodman (1)
  • PharmCat (1)
  • DomDF (1)
  • JuliaTagBot (1)
  • EthanRLeonard (1)
  • mlkrock (1)
  • lidiamandre (1)
  • alecloudenback (1)
  • andreasnoack (1)
  • HJW019 (1)
  • Vaibhavdixit02 (1)
Pull Request Authors
  • lrnv (168)
  • Santymax98 (23)
  • github-actions[bot] (20)
  • dependabot[bot] (14)
  • osorensen (8)
  • szcf-weiya (2)
  • DilumAluthge (2)
  • lmiq (2)
  • pdeffebach (2)
  • mlkrock (2)
  • herbps10 (1)
  • FriesischScott (1)
Top Labels
Issue Labels
JOSS (8) bug (7) good first issue (3) enhancement (2) documentation (2)
Pull Request Labels
dependencies (14) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 257 total
  • Total dependent packages: 2
  • Total dependent repositories: 0
  • Total versions: 31
juliahub.com: Copulas

A fully `Distributions.jl`-compliant copula package

  • Versions: 31
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 257 Total
Rankings
Dependent repos count: 9.9%
Stargazers count: 15.0%
Average: 19.0%
Dependent packages count: 23.0%
Forks count: 28.1%
Last synced: 4 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v2 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-docdeploy v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/register.yml actions
  • julia-actions/RegisterAction latest composite
.github/workflows/draft_paper.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite