copulalibA library for the copula | |
Download |
copulalib Ranking & Summary
Advertisement
copulalib Tags
copulalib Description
A library for the copula copulalib is a Python package/library to model the copulas. This is being developed under the project AMBHAS.This contains module for the following copula:- Frank- Clayton- GumbelInstalling copulalibInstalling copulalib can be done by downloading source file (copulalib--< version >.tar.gz), and after unpacking issuing the command:python setup.py installThis requires the usual Distutils options available.Or, download the copulalib--< version >.tar.gz file and issue the command:pip /path/to/copulalib--< version >.tar.gzOr, directly using the pip:pip install copulalibUsage:Import required modules:import numpy as npimport matplotlib.pyplot as pltfrom copulalib.copulalib import CopulaGenerate 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 foo.tauPrint spearmen's correlation:print foo.srPrint pearson's correlation:print foo.prPrint the parameter (theta) of copula:print foo.thetaGenerate the 1000 samples (U,V) of copula:X1, Y1 = foo.generate_xy(1000)For more details see the test.py file inside module. Requirements: · Python What's New in This Release: · Changed from function orieted to object oriented, documentation improved.
copulalib Related Software