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

Uploaded Source

Built Distributions

copulae-0.7.3-cp39-cp39-win_amd64.whl (991.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

copulae-0.7.3-cp39-cp39-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9

copulae-0.7.3-cp39-cp39-macosx_10_9_x86_64.whl (992.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

copulae-0.7.3-cp38-cp38-win_amd64.whl (991.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

copulae-0.7.3-cp38-cp38-macosx_10_9_x86_64.whl (984.7 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

copulae-0.7.3-cp37-cp37m-win_amd64.whl (986.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

copulae-0.7.3-cp37-cp37m-macosx_10_9_x86_64.whl (985.8 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

copulae-0.7.3-cp36-cp36m-win_amd64.whl (984.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

copulae-0.7.3-cp36-cp36m-macosx_10_9_x86_64.whl (984.7 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.3.tar.gz
  • Upload date:
  • Size: 657.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3.tar.gz
Algorithm Hash digest
SHA256 8806c4ff756f880e036c4e8e02ed2d70f358fa5a97e18f17064418b26b0c9188
MD5 045b936773cbe8a45a791eb939a1cea4
BLAKE2b-256 6afc6f8975bd53b0f01f175c0d8a5dcbc61b5069c70de09a0c284313cd41f5c8

See more details on using hashes here.

File details

Details for the file copulae-0.7.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: copulae-0.7.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 991.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ace7c7c68d4b681f3b772241dbc95bb2ab8d46d07c1b8d162ac0666335700ce1
MD5 778a82723e70ab4879a5d9517750e71e
BLAKE2b-256 2ea44bc30ddb5e8991b12499539a3a6cf6bec19485a6e777b50ab95559da1abb

See more details on using hashes here.

File details

Details for the file copulae-0.7.3-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.3-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e37c0fe94efa05afb69aacd40ddf0b7478944a24af7192fa8dbed7dec0353e42
MD5 c53f348ca46ee1562105d210401ff994
BLAKE2b-256 69c6b2dbfc85d5a9c5e8c83d223b7b2cd8d92b2e3ced62bfc8f2e87f2859b634

See more details on using hashes here.

File details

Details for the file copulae-0.7.3-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: copulae-0.7.3-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 992.9 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2cf244b75b575f3591db68ced9faf05c9d3a32b9fa9535aa88c2da283313a055
MD5 74b69ccf662c0d3a4765b081bfcedf2f
BLAKE2b-256 d9f1ce8a307283f191f8ae0733c2b6060a6b9d3e7915b40545f7f7730552a85f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 991.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bb0474bc954a82a437f819f7d31dd4b641c4b937a88072469827ac06e5b4c676
MD5 343163b1059e174f6f6674cd8ff74018
BLAKE2b-256 776f951ac5438f7f280db91cbb84506050fef63d24814a2b6ec49be66aef229a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f5a3147cd79b3a411222e64454559287df1ebefdbbbdf81ec9fd9894d4b0e349
MD5 592c63f7cc369eb9a915a87a567e710f
BLAKE2b-256 82cd93099d3906c3ae8d357b505e3b8b26af73f9da4085266c91af0e812a320d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 984.7 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 74f9334f78f53cb6210362c21dbb18badf5b4f0303a993d121fce850eb0aae40
MD5 45376e53b92eaf40aaf98641459eda1f
BLAKE2b-256 d297e6cb0e346b18b18041c98e505ea8ea985b8a34b9f7ce11d1164dbae03042

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 986.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 80a51535212d3db1da55b637fb20f5357a2dcacd80a92d92cd9a96999d4f732d
MD5 a6c8efa52b1c8d09b50f594d8b63d75f
BLAKE2b-256 aadf74ba79aa090507ef3102759a99ab34e389370c345d661916d60e95adf8d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 24cd59465054886c1d762c2592747c11ac61dc72eabe974e2e1d65e13eaa4780
MD5 3bbacd1047a3cde979503c6804a9af9e
BLAKE2b-256 0f0a070f3c52322eccbebbf449f385ac76001c1b096ba9bc0575e778ee1ba15c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 985.8 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6cda515fd3f59eb18a9b0d0aa858d28afd6d0704ead266c1998f34a47676ecce
MD5 a0b8c64a35d5eafde12f41d2966fac95
BLAKE2b-256 63f2d9d4e3183cc8d27a84de21f29f62f1775b8d903ba7629777f7627a582642

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 984.4 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e6d664203a03a1c3e616fc09a78a0ec3277b34915a7c5193724038c9af669919
MD5 da491fff362b3ae3b0af260b0e0becff
BLAKE2b-256 ca20438b9821cbe214174fe4968d345f28f7258761f5dbd892121aaaa7303eb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d08749ef780f704c127c2cee994f279bfeec143dbfaad9101deb296f91fb646b
MD5 4f8acb3b7932519273a7963911c349ae
BLAKE2b-256 2fa14d420c1392290c625a2028c1c63a148b3f987e979457e3718d43ce4406f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.3-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 984.7 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for copulae-0.7.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bbd7c815592d5c537a1366e16654ec3bf8a40e4cebb17d0b07387ef35d729617
MD5 8f46ffc00832131d02f223e2498d8e2e
BLAKE2b-256 74db739b46924726d8effbe129b8d6ea210662008f200efecae387b77e6d0523

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