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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

copulae-0.7.9-cp312-cp312-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

copulae-0.7.9-cp311-cp311-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

copulae-0.7.9-cp310-cp310-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

copulae-0.7.9-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

copulae-0.7.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

copulae-0.7.9-cp39-cp39-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.9.tar.gz
  • Upload date:
  • Size: 799.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for copulae-0.7.9.tar.gz
Algorithm Hash digest
SHA256 dff4582ccdf746b171eaace9ba70d03a00e57a49f8852cd3d80bf26781dc3af1
MD5 7a54832e38aab4a9f6cd98a462a53512
BLAKE2b-256 7b4e91948bac771b7bf7ae13533cd15fa40aa3294c05981eb679daabb83a8de5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for copulae-0.7.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e8b05e4996a43ae4668dff317124215c3061f6773a0e5305b76d793acd2ee2ad
MD5 da960b27ccd7ae5de00017a8f4d65161
BLAKE2b-256 7abb2fdeb49cb2af0e662758ae385c8f5784f2df58daceca38e834ae74816c07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86147f6606ca2e6965bc86013c571574d0c974e6937b529b3eae9a30cff1ff80
MD5 0c7c88cbb0e04ca4d8a183d49f63d12c
BLAKE2b-256 37954f9097d809f41a5a56676d7795e15a1f002c97677615a4665addbaa6876f

See more details on using hashes here.

File details

Details for the file copulae-0.7.9-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.9-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dfcb72556623d53b9a2fd7938e8ecac2f09eaf972348ca3af45652e23eb4cb34
MD5 42528dcadbcaabb75f87c63356030528
BLAKE2b-256 45ea51340fa44f65a04a93f689340ec048fd37e5ef15873ee5cc0b46d173de55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for copulae-0.7.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 66f843fabe4f2563dac463023aee98238632ca643e3c8e19401841d6453290ae
MD5 bfb4ac410a1410259d022e155bb1dfc3
BLAKE2b-256 2086f604ee02f550d0fe31bebbe04be31e7282060cc537894a71ee2373cce7dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4855c2bb93d17635e68f0caa3250edf4d6ff8fdc0064596cdf28792b793cba38
MD5 f8f1c101bd80b8d3cf76a2edc8fbb49c
BLAKE2b-256 9d8deb374b989272921ab336e5c9f2fd675155cf9b5ab6204b93faad82c80565

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 68e2c42744c822b0f78d08ff82bf4fdfc2b164e8c23227944036a7c3d00f89c9
MD5 329af6b96726b63db567e528357dc37f
BLAKE2b-256 ebcea4c2dba50d6039c86e7c7569094dbd602041393ad78746cb3952a1ca6b87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.9-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for copulae-0.7.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c25135beacb1b960d636a694eec1b7c32ae50ce508ec53bf78514e6698226f94
MD5 6409cc77093a51dff901f06bed534824
BLAKE2b-256 75004a0437d3681dd4267f8e408276564921f49d1a3343c9d9a86586fb5474cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02d8b1e9256dfd5347266001e8f393e3640006b79ed4a3044237bc89315ba5dd
MD5 e4154dc9fcfdae9804a5ec06e29b8257
BLAKE2b-256 ea8dcfab822a0ef99f22ea2e46a816c36e74e5315734c6e7b1ea707258f4bc18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 89074126848378b6cc83d68f19539cadf221246eed01690582dbd3cf6badd211
MD5 3f3627553a32f4c14bf552a1b446a273
BLAKE2b-256 5c283021fa452b07e68df3b0e8a9cbdb686434b5c28c07ec2ac06c22b3939158

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.9-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for copulae-0.7.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d81d31a7713672e748deca5e6465a8d71f9cad1906e13abdd0457ff60838d16e
MD5 d23d6370bdbc86bdba6651da53e99ac3
BLAKE2b-256 58ca02470d0c235d1e44d650f7ed07190832aabb8e8472ba3e76bb919e15f631

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0baa39bd2456ed008d1052ffeb7d8403ebfb2387b22b18c7ac07278d292f543c
MD5 02c1c6e6369b95610760e002ef5086f4
BLAKE2b-256 69d39720ea6db9a90d90b99d7402f819c6b26f59f60c06b7bca6c10c0bec2bba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for copulae-0.7.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 178468d372fd0061d0079b43ec81615d51c9dd792e001292940f2aa0c750a18e
MD5 af5776a475646f28ba48a6eb8851853f
BLAKE2b-256 26dc01bd94d55c5654bd3a0f791c1b9dea9d6b2e653735dab1b7d3488dfa94b2

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