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

Uploaded Source

Built Distributions

copulae-0.7.8-cp311-cp311-win_amd64.whl (960.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

copulae-0.7.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

copulae-0.7.8-cp311-cp311-macosx_10_9_x86_64.whl (996.6 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

copulae-0.7.8-cp310-cp310-win_amd64.whl (963.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

copulae-0.7.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

copulae-0.7.8-cp310-cp310-macosx_10_9_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

copulae-0.7.8-cp39-cp39-win_amd64.whl (969.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

copulae-0.7.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

copulae-0.7.8-cp39-cp39-macosx_10_9_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

copulae-0.7.8-cp38-cp38-win_amd64.whl (969.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

copulae-0.7.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

copulae-0.7.8-cp38-cp38-macosx_10_9_x86_64.whl (996.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.8.tar.gz
  • Upload date:
  • Size: 665.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for copulae-0.7.8.tar.gz
Algorithm Hash digest
SHA256 c52483ee3c080c70843293bbf22136a3b25cb8a36c106f8a990937c829fe7a50
MD5 38e6ef81bb54aefe6ca724fc9a1a6b47
BLAKE2b-256 62731efdb2c61551115dea09a38c631986f40cb664ac14c40ee85adc796a2dbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 960.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for copulae-0.7.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 95cccaa2d940a0ebf3289af79bb7828b4178634e726de81227081b8a0ecc0a99
MD5 c3aa91ba10053013b376289be5d9b1e6
BLAKE2b-256 c9d4d1648aa9279ae2ba1e40f0822d6695064b88cef57a025ea9a62421bad30e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f49339d6b7b46ed41a6f7abbb46f7ee4f119d5e24b12d253c583bced737281e6
MD5 d0879136c35ce4c86679cff335b46ef0
BLAKE2b-256 cff55d2c3c6b9c756b17c4a932d2293c9a1eef994f9f6857174e275e528d6b15

See more details on using hashes here.

File details

Details for the file copulae-0.7.8-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.8-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4f65f0d15dea2baf621f31e10624e66a3791b753d1ce95833fd4494e61473d12
MD5 0700f56f17bace835463f606a33d2519
BLAKE2b-256 3ca8f6f6e0199781a0421d57d3f1550624063407204778789b82f5c2db827787

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 963.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for copulae-0.7.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e75b974f4001e1435f312f0f1a678d072016586da03341e4cb030c479df1a90a
MD5 49b3be8de0c1158d947dbbfd369ed39c
BLAKE2b-256 e49b86134141e25b882c88ce60ea7c677928a6d3bab498ed3b27919fcae85e1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da9ed3bc3a5847c5baac4b8387b8be61e7f0ff368e1490f437eafd2291d9f9ea
MD5 e75b3f3a40c61bcf712f42e5f29f720f
BLAKE2b-256 fbc4839a49e66d9400d872bb81febc8ef358040ba43ecc3cca855a947263faa4

See more details on using hashes here.

File details

Details for the file copulae-0.7.8-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5c051bb69464c3d4ad7607b90c94e25b3c9ba2999af890c0a1035346c6c475e6
MD5 26575dd007a764e664beb326f68bbe4d
BLAKE2b-256 45d2fd68316e3591db85d6dd261b5b68eaeef51a22c398bc74f2ea621cd8716f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.8-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 969.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for copulae-0.7.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8aaff9559c9eec07e27bd14c0c1ac2b582459aa2a9ac84565a785578bc8724ef
MD5 e72c5dee6e5e247b93bf7d4c74c6e469
BLAKE2b-256 57d47c72e09cac66dd605e51a1517f05ca24f2a843af70bc742ea8ff51f09ff4

See more details on using hashes here.

File details

Details for the file copulae-0.7.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4475797cd233f582f2fce5df8f7de9fc873d6104509b4d37344c29f132642d4
MD5 cd36194ac95e0814d78ca600bd34d51b
BLAKE2b-256 3202e7d6d11775ea9e54e6698e90679308d0ae50432d450244ced18ee6fbb218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e010386587ecd6e3c33341ba5599eb4dc55c12d52b3aa4bd126a371deabf7460
MD5 0d2282f18a04799f161901acf68d0e9e
BLAKE2b-256 7ca0ded0014215c69b55c70c0f2438ce6c93a4183e12912a6a07aba09b7889bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.8-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 969.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for copulae-0.7.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 102dd69884e4f23366c90d5eb1879a963eb0d338ce05b60ea5aab005893da99b
MD5 25fef24fe906a0a74664e43cdc98c62d
BLAKE2b-256 7599a6940d38a2d75d2b988b10ef818fb1f18f0825852b2a02e810c2148d4af5

See more details on using hashes here.

File details

Details for the file copulae-0.7.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71fd031369e32e9651b7bc52cda651af8413f4903fe82a391a3a392b4269a353
MD5 564c81743b0700c5885ce7bc9f33e3d1
BLAKE2b-256 21b741882ee65ddddb28ecfe72521ef05212c1ad81c2152b679ccb3cb135881e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4cfdd0c4f3047d541b555837163319ad8686ccc3babd1ec9fbd76075c8152fb0
MD5 84f09cf96471b2cc99b5e364e8e0ec8b
BLAKE2b-256 08ba1fc679cc63eb603d330b626a219a5dd9ba49a74bbda2f531b39e85656442

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