Skip to main content

Python copulae library for dependency modelling

Project description

Copulae

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
  • Copulae 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.1.tar.gz (652.7 kB view details)

Uploaded Source

Built Distributions

copulae-0.7.1-cp39-cp39-win_amd64.whl (984.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9

copulae-0.7.1-cp39-cp39-macosx_10_9_x86_64.whl (985.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

copulae-0.7.1-cp38-cp38-win_amd64.whl (984.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

copulae-0.7.1-cp38-cp38-macosx_10_9_x86_64.whl (977.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

copulae-0.7.1-cp37-cp37m-win_amd64.whl (979.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

copulae-0.7.1-cp37-cp37m-macosx_10_9_x86_64.whl (978.5 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

copulae-0.7.1-cp36-cp36m-win_amd64.whl (979.6 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

copulae-0.7.1-cp36-cp36m-macosx_10_9_x86_64.whl (980.0 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: copulae-0.7.1.tar.gz
  • Upload date:
  • Size: 652.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1.tar.gz
Algorithm Hash digest
SHA256 a335cae03f2f8fffe1cde70e34d3fab7899f3b7c22922fbde2a2e80fa663ae2d
MD5 e8d50bce29fc650b9f13106d76076229
BLAKE2b-256 4c36dd71e17f28cfa1a0af1bd52036946e1de18718947e36a584221e3821136b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 984.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bae0612ddb42b7d58e957859dd429ad770a6cd6e529cf71354af44a5657012e2
MD5 5cef42b06e14b9e2be5f0fe610b958d4
BLAKE2b-256 0b93883cc210ab063398e7c07eb67d9a98343eecf8a9b730c8a1ab15fbc0a635

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-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.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ddde00aac17982e4451b076840bd57311471be0f419fe8063ce2f3ce4dad8062
MD5 5124f44aec0ce662ea4908ac3b79a754
BLAKE2b-256 be7511ecc63d41e0ee7d127d97dc91a47cf0bbabcafc31670d93cd41f2c0340b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 985.6 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d806c081545a727e7fa917ca70aa780c7c4c343a1bdda4aa77337b5e064a100d
MD5 8efc51bc04801f69649c5e9f48c70c28
BLAKE2b-256 366b48ea11727d285851ac1d0b3227c7da91f9afbe2b25d177648ad73dfa7fb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 984.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a3806fad5224068ee3a75428a6639ae178dbdaed2957a72f48b01a6c12ac5ead
MD5 79beadfdcf4eceefb12957d69088e8cd
BLAKE2b-256 580f7001112b2fa883f768c446a8343d81f9be81ebe09effc13f965a1d46ae90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-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.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6bb502f6ccbc48f2c17edd89b82a442b198d2b3137fd036c62e4503883aea4fd
MD5 9150129bb4a5f3043238ffb7749d0c4d
BLAKE2b-256 060eca8af578651605814b0cd3e02c33126b3059ee69cb3b86dfb82f54e94b70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 977.4 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3ab64448d33303cccfb59de4cf3ee595e2df82306bfbd72a4916715fbfd7373d
MD5 3c03d4193c741cfe494f2ad80de58baa
BLAKE2b-256 a01ad50f32e6d445866db2d6ff0c4211403a10ad42e679f48770c16b481e8e4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 979.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 12eea6458e2d2953c9ffd55a7bffaaa18fb70e8f99c93003733aa3dd718d1fc0
MD5 4fb1596622e528785b31fe3b4bcec73a
BLAKE2b-256 7c33a4f9a8de18540fab73b43bb6d44eae57fb31a699d5eeaf0ae99c2dd6b7ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-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.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 45f707a5fdbae0886cd104dd7cc3dafe78d3a09a5f9db480ae550c4ccf87f834
MD5 2566189c29af348d4b47c487f64252cb
BLAKE2b-256 2d2b38f55fca97f88fbde75a438960f468a07eb978876d8cbc147c64ffb6f2cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 978.5 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 91c845ef30db7f33b030fcd6ed52a2671ed06178e34788b4429679f1cf7db26b
MD5 a4b17b8f82493c838b2867e5fe9c8b9e
BLAKE2b-256 8f765f06031f9d82f8d984f96296f77be66f8df61971945e7670935b0695e820

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 979.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 48038fed11d565d2370c16c269a77998424520b32a1437538a379cd13f0bdbff
MD5 033b5b85d4fd49871ffb69f0028fa100
BLAKE2b-256 8e8775837d77f795a0e148f39295a4027464feea88bbf72166b7e9e4592f2de0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-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.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e74d3e3107a7062eea8f3378b04e049e43ef4c70bae7dd64bad2b80caf95cbea
MD5 a520b19db863da874b51a3d0d4e5da6f
BLAKE2b-256 a4d5d2fbebe0602ab496a35d80788799af9b1953e17288dce06b6a108aceb51c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copulae-0.7.1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 980.0 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for copulae-0.7.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8f7a4cb2c4fc807f3d1f2229ba90dd6dfe60a71bb70b06c732b19b0e665d093f
MD5 f0cefc53a17971e35aadf3cab0ae938e
BLAKE2b-256 dd06bc5c88369fc3ef2c932d0b5a7e80f59000abf8e45d438eea179fecc20441

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