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

Uploaded Source

Built Distributions

copulae-0.7.2-cp39-cp39-win_amd64.whl (991.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9

copulae-0.7.2-cp39-cp39-macosx_10_9_x86_64.whl (992.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

copulae-0.7.2-cp38-cp38-win_amd64.whl (991.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

copulae-0.7.2-cp38-cp38-macosx_10_9_x86_64.whl (984.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

copulae-0.7.2-cp37-cp37m-win_amd64.whl (986.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

copulae-0.7.2-cp37-cp37m-macosx_10_9_x86_64.whl (985.5 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

copulae-0.7.2-cp36-cp36m-win_amd64.whl (984.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

copulae-0.7.2-cp36-cp36m-macosx_10_9_x86_64.whl (984.4 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.2.tar.gz
  • Upload date:
  • Size: 657.1 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.2.tar.gz
Algorithm Hash digest
SHA256 225d7c4443d997918a1231da1f0afa834f4ad11ce2923a1f331f1ed5be8b8907
MD5 816e0fbd8a194f366e9e882c8bd482aa
BLAKE2b-256 9aaac0b6ac922f2614810382daf92fe184e4a6d05d3a4979519f3537247281a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 991.7 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.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a973b9b7b5ca42ab12650449e766d06337a691e736ddafc335a81db08edb70b7
MD5 7340c0b6a02a76cdad1dd9426f5e6a95
BLAKE2b-256 97f733c2c319b6b3d782a63e5f413f3be287cf8b84cc40760ce0daa76e5e9fa5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-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.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1a70d594fdc5739174cbd28c3f511db05902062486ddc196fe15f56958190c6b
MD5 0e2ae6e1cf9eaf989ec31a51d2b1e074
BLAKE2b-256 b0657a6471ac1a1ed2c0feca603938e9bde90dc1335d80e1451ec76165757f07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 992.6 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.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dc98ac6098c9857726962e568222f055502d3fd5dcf19f285fe9bd97d842f3c0
MD5 1a1ea4e2b60f7a2f8e4d15a13ee85927
BLAKE2b-256 2c25f21c7f50e28f419c891b726ea8905364198418c0faf94a8440657174904d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 991.1 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.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 62fe230018f6c990bce6057d0edc580af9a4076307fe5d239a4e743d740206d6
MD5 8be5d47fb277ac882b11ea2cbf2848bb
BLAKE2b-256 2dea4e91346f2946fb28260cc71980a2ab12638ba56eb5a2ab67890c4e8e6eb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-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.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b5b67faeec3c38904c4fbb7499eef3accf9f046ca95810d2962e9d99a7473b27
MD5 2647f3d3cc234ec548e15722b5b21c6f
BLAKE2b-256 23c6b5e62ef4360963309036a895925843ce33ea1dde6e7808c3053921171e5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 984.5 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.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bc7c5cf81271b3a6b3d9deafbe39e5a5c285ec05d015d70fc2003daf0484d978
MD5 ce2b5fb532af99a1f676e695cde730d1
BLAKE2b-256 896316310e39ab20bc0ccfd5c87a4c8b9d15b852636664e854b519c32a4c1bdc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 986.4 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.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c536c18938867bf21b11be87752c42c4da822ad980230d4012e8d608d9878000
MD5 f81791f020144148aeff6ce6360424d0
BLAKE2b-256 0aa400706276ce24d12aec7a8025d8e9e7fb11a5df6137a87b0ef82474afde2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-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.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ed7c6cdd631c8462489b9f7c7a9911671acb1b1c7cee59ef455aaead95bfed89
MD5 b6c6ceb240f8987110ce11c86b59ef92
BLAKE2b-256 b28c67bbdd138f342ebc73f699e33e0968d4b55ebd29868d6f4ea9ae93a58206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 985.5 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.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2ba6dd61c6184b30e84036de1b9121faad751ff3c05df795d0f48d4adcae4500
MD5 d1fdead416f2e9c3830566ec3c72c10a
BLAKE2b-256 829f00503766408c17f16f39c9153bb75ab503df3f4ad993525da5a5384d6411

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 984.1 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.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0c9b7538f5a47aa2f79b241c4513251147616486b58898fdef013f8d95897bbd
MD5 559440b5c40ae5d01eb0541ff705632d
BLAKE2b-256 9cc99ed91744cfb86ce389d59cf611dc5c404c28385d02588a23861084323cf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-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.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e3a918e02837554da85a3b0413cc638ffdea9b26db617e1e03de6dd1927f22f2
MD5 37d965ad95fdb91f7b4b40c9d0b499bd
BLAKE2b-256 572aaf2021556db90c50284b3838c9d870e7d1a77ebb8f42384f4f0990d439ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.2-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 984.4 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.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 64b8436fd053b41a65689a8db629d48e15ed4699c149e75031d3a36996ce481c
MD5 ed76eacebbdccaec27e4508bf8e191d7
BLAKE2b-256 07b32ad0d54ce25b7189098d52056509dc967ac090540e752fe8595a09a392af

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