Skip to main content

Python copulae library for dependency modelling

Project description

Copulae

Probably the second most popular copula package in Python. 😣

Copulae is a package used to model complex dependency structures. Copulae implements common and popular copula structures to bind multiple univariate streams of data together. All copula implemented are multivariate by default.

Versions

Anaconda Version PyPI version

Continuous Integration

Build Status Anaconda-Server Badge Downloads Anaconda-Server Badge

Documentation

Documentation Status

Coverage

Coverage Status

Installing

Install and update using pip and on conda.

# conda
conda install -c conda-forge copulae 
# PyPI
pip install -U copulae

Documentation

The documentation is located at https://copulae.readthedocs.io/en/latest/. Please check it out. :)

Simple Usage

from copulae import NormalCopula
import numpy as np

np.random.seed(8)
data = np.random.normal(size=(300, 8))
cop = NormalCopula(8)
cop.fit(data)

cop.random(10)  # simulate random number

# getting parameters
p = cop.params
# cop.params = ...  # you can override parameters too, even after it's fitted!  

# get a summary of the copula. If it's fitted, fit details will be present too
cop.summary()

# overriding parameters, for Elliptical Copulae, you can override the correlation matrix
cop[:] = np.eye(8)  # in this case, this will be equivalent to an Independent Copula

Most of the copulae work roughly the same way. They share pretty much the same API. The difference lies in the way they are parameterized. Read the docs to learn more about them. 😊

Acknowledgements

Most of the code has been implemented by learning from others. Copulas are not the easiest beasts to understand but here are some items that helped me along the way. I would recommend all the works listed below.

Elements of Copula Modeling with R

I referred quite a lot to the textbook when first learning. The authors give a pretty thorough explanation of copula from ground up. They go from describing when you can use copulas for modeling to the different classes of copulas to how to fit them and more.

Blogpost from Thomas Wiecki

This blogpost gives a very gentle introduction to copulas. Before diving into all the complex math you'd find in textbooks, this is probably the best place to start.

Motivations

I started working on the copulae package because I couldn't find a good existing package that does multivariate copula modeling. Presently, I'm building up the package according to my needs at work. If you feel that you'll need some features, you can drop me a message. I'll see how I can schedule it. 😊

TODOS

  • Set up package for pip and conda installation
  • More documentation on usage and post docs on rtd (Permanently in the works 😊)
  • Elliptical Copulas
    • Gaussian (Normal)
    • Student (T)
  • Implement in Archimedean copulas
    • Clayton
    • Gumbel
    • Frank
    • Empirical
    • Joe
    • AMH
    • Rho finding via Cubatures
  • Mixture copulas
    • Gaussian Mixture Copula
    • Generic Mixture Copula
    • Marginal Copula
  • Vine Copulas
  • Copula Tests
    • Radial Symmetry
    • Exchangeability
    • Goodness of Fit
      • Pairwise Rosenblatt
      • Multi-Independence
      • General GOF
    • Model Selection
      • Cross-Validated AIC/BIC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copulae-0.8.0.tar.gz (803.8 kB view details)

Uploaded Source

Built Distributions

copulae-0.8.0-cp313-cp313-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13Windows x86-64

copulae-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

copulae-0.8.0-cp313-cp313-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

copulae-0.8.0-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

copulae-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

copulae-0.8.0-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

copulae-0.8.0-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

copulae-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

copulae-0.8.0-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

copulae-0.8.0-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

copulae-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

copulae-0.8.0-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file copulae-0.8.0.tar.gz.

File metadata

  • Download URL: copulae-0.8.0.tar.gz
  • Upload date:
  • Size: 803.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for copulae-0.8.0.tar.gz
Algorithm Hash digest
SHA256 4683573d59cb07d63e2b7d4643c19890dd806b03ce48db75ec6a5389039514f8
MD5 b036d2308125431ea77e353324ad4342
BLAKE2b-256 e7997566f480021ac5d705567db113f84fd8bca9abcad6369ed0fbea4089b320

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: copulae-0.8.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for copulae-0.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7252354fa59948b0770b9c6da0c7994516bb828843f8763bc84c3dc8519d762f
MD5 d4e240c0cf5bbc02f573c675814d67b1
BLAKE2b-256 908e92d55d73c79e2c9e7ca8031dad40f1b47ba56b2f9464817dd8a7c386bba5

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf33ea2bb9b1fb98f9db4a116aa3b781c8410f150e58ac4f8ca6ab87d800755a
MD5 4d9341098babc58dd78dcbf8d05ab9f2
BLAKE2b-256 dccef78fde618807d79f3f54fa7f12ccbafdbc06105966e6636aa5df4dd6c9cf

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d025f721640564b5844e1bec8933b7bfa07117daed5af1d2c2eef48f5af2cae
MD5 e21da7dc5721cd6dc5de186d8a5d8e0f
BLAKE2b-256 6167425341d91101ba1fa2a1ff30a25ec685fcece2f29c229db3099665d1441f

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: copulae-0.8.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for copulae-0.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b73fdb37be30f892387624fa1b6bc0ca7da1b6dd1f0ffe3aea7ef42eec134ebd
MD5 467dc020e12be135163eb2ae646da82d
BLAKE2b-256 347fdee7853339e5898760024f3f07307043d674fe769574a81a70d39ac4645b

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 001ec42e4473ade21d1a675c774c14b0e123f94d5eda6d36f0f524a124224257
MD5 8d961677279365a66304da8b8fd64536
BLAKE2b-256 2e6f3ee29b531ad55ba3d5bbe131d1dde3012ab182bf4e51bba9512030c30e55

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5d4690ed1abc7f968c2618807f4eae6e4844728e23744464f0ba6cd2a96deeb5
MD5 9c657859c46e117dd3107b23a0e8516f
BLAKE2b-256 35d65527103c53cc9986a6ed7623a847558b959baa54307c5ab1f4de2fbcc4af

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: copulae-0.8.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for copulae-0.8.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 579dc5c8ac1cecb45976ba8139789019d8da663bbd3fd280569fa99cacf27321
MD5 579b7ab46e30d51af144749843fbfaad
BLAKE2b-256 48e8c437728de774e0fafb6dcb3951a42e2681df067ae10ec5a92c51b6f2c293

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a39592d2518b6b3885e4010507cf31cb32983d421d1e893e7e65b19d1b8175c
MD5 cfb56e5420acaa365de8d5b89ffe3571
BLAKE2b-256 c4a08ef941099f85e1926e060d7c72961d52dc242e7dd58b53bb5c06d2ca52a4

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b45553453b2722026555dc0d1c782cdb76ba0344e5b087cda3d7e425d924506b
MD5 48c9da908be39628b04badfef0362037
BLAKE2b-256 94f56b66594adb3bc2ae0bf77731eb2a1032da47497e60548379ce55ac68c379

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: copulae-0.8.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for copulae-0.8.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bd2b4c5f1a681f162029e1f25bb50c67e42232c6a40daeedaeb9095fc758513b
MD5 63ef1ee2f0b0830c9403326ac533484a
BLAKE2b-256 11696be58e9eadf70c59cafe70591eb256622634a4e90b61be5a0854d77d7c8b

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74a861ca2c1072897a71f9a733dc13e84e78f5674c00f22e95c9d611d3a6ea52
MD5 95453e943bbc3fe147007cad1427c83c
BLAKE2b-256 1ef1b6adb82efeea2969369e7cb30a428208921dd7b0bfaf44136248dc51e40e

See more details on using hashes here.

File details

Details for the file copulae-0.8.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for copulae-0.8.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c1d114e40e81d96e687d56e8eda8a74077193a2b429b61386adc69337fadc04
MD5 8ac80777bcf1e9ca3b6b157665f43834
BLAKE2b-256 eec59ed09fd7b974908ac289dd88d5fcab61c438253a563aced0727f83176d96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page