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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9

copulae-0.7.4-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.4-cp38-cp38-win_amd64.whl (991.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

copulae-0.7.4-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.4-cp37-cp37m-win_amd64.whl (986.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

copulae-0.7.4-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.4-cp36-cp36m-win_amd64.whl (984.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

copulae-0.7.4-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.4.tar.gz.

File metadata

  • Download URL: copulae-0.7.4.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.4.tar.gz
Algorithm Hash digest
SHA256 33978b4bbd8db8de9895e389c3317550534f0356b2333a2764aee02151280ef6
MD5 a1054da5aa6715643676d17de8d17561
BLAKE2b-256 4f5c3eb26ad7b6bfe1542029b5ad285626c0cdec93d90b4774a5709d016c2ca3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4382a0ffc928752e07cc4c431012c69bed10758abbfa6bd60aaa26a1a3f47b46
MD5 846343a43c2d2c6254857f25d4f9912e
BLAKE2b-256 34a1da3e5cf93bbfe1468e2313dae68b466b8fc3050bf3af4276fbf8f1f77f35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 edd6a7710cb57d31c8b4d1425ab52647d5728666a2b0f43085db4e725ef189e9
MD5 d076dc2e8cb566b2624f8a61a914c3ac
BLAKE2b-256 3fc8b95a828669fab4d402853132c92f73c907d21642798750510301e6546911

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0e86f910810e115a74cf7c8723d87a56d623131435c4c673243a9ebe66a78fc8
MD5 d8a35ef26bff1528d3e4a30e060dbb00
BLAKE2b-256 6608dc211ae9906b4778ae513502aa5b940f20a3739832f4fd85347f1c75cc43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3fe470454fd0e1220a46bc829000b70e6cc70412e4f95890c82e4f136414bbf8
MD5 867eeb43f0df609ca7815eb3f1a6841e
BLAKE2b-256 fc6dacb5b74d1eb88f2f7bfd03adb92725d7fc171525f1717382a183ffc09fbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ca4c00b7dae0e88a8e90b89429a0498e9984750c95ff41621ada13098db6de9a
MD5 9671cfc6d3a124ed81722b982ed2cfda
BLAKE2b-256 9e5afe3073c8174c3be63a638a749c9cfb4509aba132dd5e93a40aac9e20487d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9774636c2e96a67a3c6e68fa154565862ba183e4b7ce908c01de0a83e95e1c5b
MD5 de3e8c4698633ce144184cb450408f35
BLAKE2b-256 5263eaea49c226035adffce2976adf01cc496653d827eceff146e156ae82863f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a2bf9992ed92ae0bb59a9d6418641f866ae59163acbdc83e08cdfdb65269fe5e
MD5 87db519645bfba65a0e15f84fb016222
BLAKE2b-256 92b668ad1ceef7aa4affcf788b118d2422f38560f49ba5dcae11f31c7644071c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1052e6a9446ffa9b81cb6eb7cf250466fcc343392a43024e1e6e833fca1d29fb
MD5 c7319a88d27de457c24859ad1e2e69e4
BLAKE2b-256 f38ab5ae9fe1e69a0b5a7afebc4e4245c5da3bb88b443eb94525e553c9d8b1d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8ea6901357b5610c702e37c39be758ef3fb6267ea1e28fb911670b58da1fa4e0
MD5 cc54e176c03026f78b597622408ef4c4
BLAKE2b-256 db66cda1c8694bba334c795de004aecb2eb689d32b808327a278bad79b0f7761

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 cd9ab305841bc04dfffec4ceae8f0af85f93c57d569592ac333c858b595bc1a2
MD5 80a8cb1571783974c426bbc728acde59
BLAKE2b-256 bc65f60502805c407aaa18b831231683a36ec84dc5a3062969ed183f32c83c11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 92b94f7144c6c4c338175bd120de16e0caaf0315236dc5fb5e622ca64ced5ba4
MD5 19ca2fead1fd11adc767cec32a9a0cbf
BLAKE2b-256 81df158594298e4a0bd92018c6ce4a5d2b053787d1a3f51f7454503ca6b9e7df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.4-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.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7e7b5ef4725970f8f7dfe6f7595cba15f9a6096475cf132f6b48c49a2125273e
MD5 02c742add5fc90baff23e9f2ba18e93f
BLAKE2b-256 1c6cb7db4ee6ffa45efcc87c53fcde28eef348a8bd2deaa32dadc31dbfadfa78

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