Copulas
Copulas copied to clipboard
added Copula Bivariate Joe Functionality
Description
This pull request adds a new copula class, Joe
, to the Copulas library. The Joe
copula is a popular copula function used in statistics and financial modeling. It is characterized by its ability to model positive dependence in the upper tails and negative dependence in the lower tails.
The Joe
copula is defined by its generator function and probability density function, which are implemented in this pull request. The generator function calculates the inverse of the copula's cumulative distribution function (CDF), while the probability density function computes the joint probability density of two random variables.
This implementation follows the conventions and coding style of the Copulas library and includes detailed explanations of each method and its mathematical underpinnings. The Joe
copula is a valuable addition to the library, providing users with a flexible tool for modeling various types of dependence structures in their data.
Changes Made
- Added a new class
Joe
to thecopulas.bivariate
module. - Implemented the generator function, probability density function, and inverse conditional CDF for the
Joe
copula. - Included detailed explanations and docstrings for each method.
Example Usage
from copulas.bivariate import Joe
# Create a Joe copula instance
joe_copula = Joe(theta=1.5)
# Fit the copula to data
joe_copula.fit(data)
# Generate samples from the copula
samples = joe_copula.sample(1000)
# Compute the probability density at a given point
density = joe_copula.pdf([[0.5, 0.5]])
# Compute the cumulative distribution at a given point
cdf = joe_copula.cdf([[0.5, 0.5]])
# Compute the inverse conditional cumulative distribution
percent_point = joe_copula.percent_point(0.5, 0.3)
Testing
- Added unit tests to ensure the correctness of the
Joe
copula implementation. - Tested the copula against known theoretical results and empirical data.
This pull request is ready for review and inclusion in the Copulas library. Thank you for considering this contribution.