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

Uploaded Source

Built Distributions

copulae-0.7.6-cp39-cp39-win_amd64.whl (992.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

copulae-0.7.6-cp39-cp39-macosx_10_9_x86_64.whl (992.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

copulae-0.7.6-cp38-cp38-win_amd64.whl (992.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

copulae-0.7.6-cp38-cp38-macosx_10_9_x86_64.whl (984.6 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

copulae-0.7.6-cp37-cp37m-win_amd64.whl (987.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

copulae-0.7.6-cp37-cp37m-macosx_10_9_x86_64.whl (985.7 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

copulae-0.7.6-cp36-cp36m-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

copulae-0.7.6-cp36-cp36m-macosx_10_9_x86_64.whl (984.6 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.6.tar.gz
  • Upload date:
  • Size: 657.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6.tar.gz
Algorithm Hash digest
SHA256 1fabe5dc3b6576d419ee5675ac759af48de989cf62bb5c4a15dee8d6b69d4650
MD5 97983b87bb80a166fd729967deac082b
BLAKE2b-256 79beda8768b743fe23e21af0ab691347aa32db96776bfb314c004563b1f001c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 992.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 87a435f15b285f9ac709bea6754f88a8f4f603d94a5ba9807d93534a2af7ffc0
MD5 e8136aecd4acd923ea08c653095b746b
BLAKE2b-256 094e8bf87c2d042fbcac3be47233c2801a2ed7847b3070568fc2fd419d6eb08c

See more details on using hashes here.

File details

Details for the file copulae-0.7.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7c835b22a809d0a7d16f101271a26fbe97c22c772a2ad6a2d0a60d2cd90b983b
MD5 519784d337aa40910bc0aa5cb69ec3e7
BLAKE2b-256 dfa7dc45a6469fb245dcd05c4f725e519ebce82011516b0f58326535c94613dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 992.8 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2a50958ea63ec097444fa2fb2e0342c5c4b66a163c3ad207d3dba02c00df7c5d
MD5 626101b3e1d819b3a03d762a2c26827d
BLAKE2b-256 ee8557df870acc5e229788b40c5a0eaae87f612cce7ba248f1812d2adabd9254

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 992.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 465678047980865d894ae4427800583abd1c8c22d575935dbfeacf85928e1afe
MD5 88beb4e96e568cdfc6597161d9047f3f
BLAKE2b-256 1154bd626e03013e142a8503a1b2d204934378c471c955502c3c01bd7db67fb0

See more details on using hashes here.

File details

Details for the file copulae-0.7.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f3989c84bc9d48e4d2de5bf1d54ecdaba778042d26ee205244ac9bafbc2cc7c6
MD5 2e0fc2537f7ea6e555ef54dacee854a9
BLAKE2b-256 1819699a77991c7b6fd1a8bac5e50b10d35a63060e000ded92890bb237ecdaaf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 984.6 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3c27ad5c0d3606800799cc9466388712f19199749f9b341cc724b71280259b6
MD5 a13dff957b94e35e688bf0e8a470ac0e
BLAKE2b-256 d0bb7da83073881559c39b1e239d4d4215f70c4dc35166a437d6438b424a16fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 987.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 94a1c89523b8ba8c1ed6e3fd55b8009ea3da54dc9abc562a7f230160d6969198
MD5 7ea66221c79c54d9cf996792d73596b1
BLAKE2b-256 6d2c2399dc0adbe2ed72390ebd0a9e40baf364acca73b51c8d9c09cb3d606a1f

See more details on using hashes here.

File details

Details for the file copulae-0.7.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd996c3753751f30e411fb4429ebf78a70295524eb29de2e69fcff2215a309f4
MD5 e7170eeb25777021becb818ee1d87be5
BLAKE2b-256 25bc83c74f7cfdddb06b86bdd23e2d115ebcabddf6c89523dadf66b3438882b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 985.7 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 71e8f5d2d3fe6282a759aad2fbcd31f51038b6a3414a6462e9b555938149daaa
MD5 70d4d61c668762f323ede0bfd094e632
BLAKE2b-256 de535e3a6ec4c7e621abf6d1a6d4fa0a9ab2e0d51825c33e0e817c5f8879612b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 911bd7dc584c2943c701e4bf3615060bacaeb147594bd132d3316ca1ce64c8ee
MD5 5974ff80d3a9ba87a5deeed3be03d708
BLAKE2b-256 50fdb6fe623dbd1bbaace672c67fe7a921b1122abfaf6cf5b9395b37c71f5775

See more details on using hashes here.

File details

Details for the file copulae-0.7.6-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for copulae-0.7.6-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7ab1571c0c0164aa4a415495d32090c0cfb0d98073e22e2768eea16f3c3e4455
MD5 9ed1a66d70572411dcc26428d250cb4a
BLAKE2b-256 9ce60a06c39020cfb867d274ff1f9b33125abf2d00f309ee5a351853427fe879

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.6-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 984.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for copulae-0.7.6-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 08edc60e6c7e245ec782acb054bcd0080048a235a72260277b4581510281340e
MD5 948ae2525f3cc6e1b18541a861d021a3
BLAKE2b-256 a0cef6803bdc483ee2a01f63da15a2b6669c871343dc4139efce7d945fc7941e

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