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
Continuous Integration
Documentation
Coverage
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file copulae-0.7.7.tar.gz
.
File metadata
- Download URL: copulae-0.7.7.tar.gz
- Upload date:
- Size: 660.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f1ff2d0a538b3b7c9270955782caeac289165db589bfc06c889fa4f6590a6be |
|
MD5 | 78d98c24e31795a5e7e0ea4230fef5e2 |
|
BLAKE2b-256 | ba04eb3ea9bed2dd87b8969ba211b5fc3e7ece6806ae3fb45b578f61017ca97c |
File details
Details for the file copulae-0.7.7-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 995.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3993bffd275ed8420cf74120047c362e2de5c943bb776059e00c7219bf0799b |
|
MD5 | fcaa461ac1652a672f8f80e361a6d95e |
|
BLAKE2b-256 | f950fa7d741aeda6d6246c13efd8a6b25bb1e309bd22a59c002e693e7625f9cd |
File details
Details for the file copulae-0.7.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afb9db3c7734070a39f6edc9acae96e695e228f0aaad9c930b859b0415cbb355 |
|
MD5 | 6177bc124af3727aded3181612d724c8 |
|
BLAKE2b-256 | bf6f44092141ea344170b6afa3b660da06d0166430313357f61fd4d707ab70df |
File details
Details for the file copulae-0.7.7-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 998.7 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 636d6d78e58e88d4f715e4ddb6fd03103c01e83e16bfeec906a4e66d092630a4 |
|
MD5 | 23c3157973f10376cc97f79621611bf4 |
|
BLAKE2b-256 | 067b5ebc9641915bce809a7dfad9a592e2448a0e602028d98b143f3148a49abf |
File details
Details for the file copulae-0.7.7-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 995.6 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4d98d05384ed96116f5d90244f6dde9f31516cb042e4eaf92959bcf0d141aa1 |
|
MD5 | b0d2b1d1534fc13e348efdb571bd32e3 |
|
BLAKE2b-256 | 934d56e2266d4e3a571e097d9495578006edeaa2ef20d465247abbafab7a683a |
File details
Details for the file copulae-0.7.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d78056230584f863ed1ece1f57cc92de4186e9d95fb826f551ad2e702bfae43d |
|
MD5 | 71f0c84083f387a81145bf93d78750eb |
|
BLAKE2b-256 | daa02dba7496aceca1dc867a141df68cdbb1295d94060779feb1b593b5be79aa |
File details
Details for the file copulae-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 998.7 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb073f915e2e226a3ad04210b6116c83e6940e0f95ebdbe8df92b796c17c85a5 |
|
MD5 | fc9c33afcb90d9a0ee5eb816bbc0efaa |
|
BLAKE2b-256 | 3ce9aaf25423d028030da616b922d0ded2aebe7450c708d0cfc87a2e1ddf8df2 |
File details
Details for the file copulae-0.7.7-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 994.9 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 465feaf07cae826b44507f136422d230fd35eebe1d82837705b42c3630b2ef47 |
|
MD5 | 630d615d30efa2d31c54c54d0e3d9387 |
|
BLAKE2b-256 | b305cc0c37831a80ec3851d346444d9793d66e602220b2f1485756e2a7535846 |
File details
Details for the file copulae-0.7.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0499ee10b3a2f4293769cd66b31e5e0b35847e7c93172233488ea53d004ac4f7 |
|
MD5 | 17e03074fd50ec191327f4c5b1351778 |
|
BLAKE2b-256 | fbdc047050fd6ef0fa9756b55f76a495d154fce0b73c87993eb3d5b6c7c4ee70 |
File details
Details for the file copulae-0.7.7-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 990.7 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c674049963e504e2885de206f6c07a1d45e63311c7352c87bd18cfcb10e1fc |
|
MD5 | 4f1df8a9c6371011f24bfb26e980369f |
|
BLAKE2b-256 | 678afcf5d6954c7605ec8ee50e3ea19b64c0769129bf8d4c966a0827fea0fa53 |
File details
Details for the file copulae-0.7.7-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 990.3 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4aa08f62a23e1c05a18d0db84a63f9f6826eda101765656735f9d2994eca61f |
|
MD5 | 8a4757798c5a5ea4ed0ac0615d55ff00 |
|
BLAKE2b-256 | 476a4e9cfcf4bcd5ee4839854b3bc51197fb3f70709bd45aa615a6e257f18f59 |
File details
Details for the file copulae-0.7.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a90b506f5770ec6b50837edb3d6c7d27935c9dae6760e983a3128a426e9a96ac |
|
MD5 | 74fd46474904bd5c696f9e2f82ac9254 |
|
BLAKE2b-256 | 3427b27fe4e0652109b3445f771458c2a6713cc0234d9c60dd4f895cdbd2e351 |
File details
Details for the file copulae-0.7.7-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: copulae-0.7.7-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 992.9 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f51ab9559106b871acb6229fe7291a5c5be5d260d3a4ef2d4bf3627e3c056fa |
|
MD5 | 7e7f7d85eebc6c3b2dbf9bd5258959a3 |
|
BLAKE2b-256 | ddffef9353ce33dcd9dbf3f8826140fdfc97291e6cb4aa0b468c158ba7c7cb2a |