Skip to main content

Python copulae library for dependency modelling

Project description

Copulae

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
    • Add sample problems
  • Elliptical Copulas
    • Gaussian (Normal)
    • Student (T)
  • Implement in Archimedean copulas
    • Clayton
    • Gumbel
    • Frank
    • Empirical
    • Joe
    • AMH
    • Implement Rho finding via cubatures
  • Mixture copulas
    • Gaussian Mixture Copula
    • Generic Mixture Copula
  • Implement Copulae Tests
    • Radial Symmetry
    • Exchangeability
    • Goodness of Fit
      • Pairwise Rosenblatt
      • Multi-Independence
      • General GOF
    • Model Selection
      • Cross-Validated AIC/BIC
  • Implement mixed copulas
  • Implement more solvers
  • Implement convenient graphing functions

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.7.0.tar.gz (659.6 kB view details)

Uploaded Source

Built Distributions

copulae-0.7.0-cp38-cp38-win_amd64.whl (990.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

copulae-0.7.0-cp38-cp38-manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8

copulae-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl (993.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

copulae-0.7.0-cp37-cp37m-win_amd64.whl (986.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

copulae-0.7.0-cp37-cp37m-manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.7m

copulae-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl (994.6 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

copulae-0.7.0-cp36-cp36m-win_amd64.whl (986.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

copulae-0.7.0-cp36-cp36m-manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.6m

copulae-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl (996.6 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.0.tar.gz
  • Upload date:
  • Size: 659.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c3f0f18a2a1d85a0a55656e69439d5234eaf2f92aaca7cc93f789ea926974c9a
MD5 dcc7cb2ac0f884a4d7e85d5b57627a48
BLAKE2b-256 f2be014567d948b2b26d89bdf44c8a98b1efcaf50cf4aef544c47093af2c012f

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 990.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9d99f4e7db7f7e0d7f0b3c8fdb4d528732891a08d5cb6061ac99645f618adb9c
MD5 2c689346a2b3a62a8e24ab7924d8611d
BLAKE2b-256 1403f5f40f17a0cb167faa9136cac4251d496273b13560a0e96ebdd74fd2f3a7

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f0ac63421700952b67d11ea3ec827c7f86019d600c5561527d8abb995da792e8
MD5 ba603684568957bd302a9d23fbc7bf7c
BLAKE2b-256 200cd0824ec8f7429cb1975013cae7b6f2b738dbe1776de39cd27df2c645f59f

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 993.0 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 189c1f2ec2f25b13dc9d09559f03be7b1b888a13c2e653f98d591694f7588ee7
MD5 2d581a3bfa2789a3dd5a863f83f5af6c
BLAKE2b-256 334c067ea5b88af872badfe93b424f157db3d1ba69f5b29ba4ba90211aa9d310

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 986.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 10f7e34ad6b6ff62375133c21768af3bf9a029ce1353245344e73a898999f2e4
MD5 98a92154dcd835b932e88ba58ddbef16
BLAKE2b-256 f63dc3e950e5f98a71c41bad6dd6f270b9933ad33b0e8ff34b00766b1930e75f

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0c0a4975431c9983c022a7ae4e45f70f47927ec5688c34d49baeec2aa5054599
MD5 a8db457ae98b00e19d11f818892d2dc5
BLAKE2b-256 382c28b1b0bacea8663690236de6faafa37cde7d535f05868eefd4e8f2478f26

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 994.6 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2348bc21feb677b2b8c3a80084cd5f05dc8fa08e4cf8da7e52248d77b95baa07
MD5 aa5b97ecbb7a533dbf80e9bf6b15febe
BLAKE2b-256 fdbfbe92fbb54b259aef085a81d53d3af24760325c1e10624e4d602e327305b1

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 986.2 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 7a8330f7fa3cff2125750fcfab6fb7f52cf907099253c8bdad723c8e46671d7c
MD5 bdabf5312505493e971d63e8aa289d49
BLAKE2b-256 0e18dcd70f2b3e18e14a2196b93ab4b7d9fac4c8b8c2016199acd4331905e9a4

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ee7791257c04e4096aed3b6fbd1f7ec307b211b38b5a6e4d13885e19d21833a3
MD5 e5f14e3f655b7f68461424de58015944
BLAKE2b-256 68af4eaf6520b8feb70b131e0bc00bba1a6b7ad727d5891c46eb5109d3d63b7d

See more details on using hashes here.

File details

Details for the file copulae-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 996.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.17

File hashes

Hashes for copulae-0.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d14d4ce1bd6064662f146fcbfbce731ccc204f7e2e37a2f0778bbf1a9a415d20
MD5 d3b0512d6a0f346113a684ea9fd86c08
BLAKE2b-256 a7e304a9501e5fd0dfa2c02a164fd907f84dcb44273831199530f480f1310ab4

See more details on using hashes here.

Supported by

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