Skip to main content

A library for the copula

Project description


This is a package/library in python to model the copulas. This was developed as part of my PhD thesis.

This contains module for the following copula:

  • Frank
  • Clayton
  • Gumbel

Installing copulalib

Installing copulalib is done by

python install

with the usual Distutils options available


Import required modules

import numpy as np
import matplotlib.pyplot as plt
from copulalib.copulalib import Copula

Generate random (normal distributed) numbers

x = np.random.normal(size=100)
y = 2.5*x+ np.random.normal(size=100)

Make the instance of Copula class with x, y and clayton family

foo = Copula(x, y, family='clayton')

Print the Kendall's rank correlation


Print spearmen's correlation


Print pearson's correlation


Print the parameter (theta) of copula


Generate the 1000 samples (U,V) of copula

X1, Y1 = foo.generate_xy(1000)

For more details see the file inside module.


Version 1.0.0 -- May, 2011 --- Initial release

Version 1.1.0 -- June, 2011 --- changed from function orieted to object oriented, documentation improved

version 2.0.0 -- Oct, 2022 --- Updated for Python 3, removed the dependancy on statistics library

Any questions/comments

If you have any comment/suggestion/question, please feel free to write me at

You may go through to see the examples.

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

copulalib-2.0.0.tar.gz (13.8 kB view hashes)

Uploaded source

Built Distribution

copulalib-2.0.0-py3-none-any.whl (14.5 kB view hashes)

Uploaded py3

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