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.

Continuous Integration

Build Status

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
print(cop.params)  

# overriding parameters
cop[:] = np.eye(8)  # in this case,  setting to independent Gaussian Copula

I'll work on the docs and other copulas as soon as I can!

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
  • Elliptical Copulas
    • Gaussian (Normal)
    • Student (T)
  • Implement in Archmedeans copulas
    • Clayton
    • Gumbel
    • Frank
    • Joe
    • AMH
  • Implement goodness of fit
  • Implement mixed copulas
  • Implement more solvers
  • Implement convenient graphing functions

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

Uploaded Source

Built Distribution

copulae-0.3.0-py3-none-any.whl (93.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: copulae-0.3.0.tar.gz
  • Upload date:
  • Size: 94.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for copulae-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aa25d27a0d9bb1b4b0a1cd4cb7a64b8b3bc52f67a1ce988f690bff6f5f7be38d
MD5 f0a2cedbdba8e77098033496643f29e6
BLAKE2b-256 7223f6c26b1c006dbd28113c03432e60d2188d528ed9dfd2ac967b812f401703

See more details on using hashes here.

File details

Details for the file copulae-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: copulae-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 93.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for copulae-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fc7ee97db640c037260b3d2f3d67f1d17bccdeb61472c21d64d15cbf0e44a5e
MD5 794931e283edb4515a6e06ab5149abcd
BLAKE2b-256 29ff889b78ee85798a5339f298118e6d9eaa1bba174688be93ab1142e7d02bbb

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