Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gumbel copula partial_derivative incorrectly documented/implemented #277

Open
LiZhongyangLi opened this issue Oct 28, 2021 · 0 comments
Open
Labels
bug There is an error in the code that needs to be fixed under discussion Issue is currently being discussed

Comments

@LiZhongyangLi
Copy link

Environment Details

Please indicate the following details about the environment in which you found the bug:

*Copulas version: 0.5.1
*Python version: 3.6.3
*Operating System: CentOS Linux release 7.9.2009

Error Description

In the documentation copulas.bivariate.gumbel.Gumbel.partial_derivative is described as the partial derivative w.r.t. the first entry u, but it is implemented w.r.t. the second entry v. It can be verified numerically.

Steps to reproduce

from copulas.bivariate import gumbel
g = gumbel.Gumbel()
g.theta = 1.2
arr = np.array([0.3,0.2]).reshape(1,2)
h = 1e-5
eps1 = np.array([h,0]).reshape(1,2)
eps2 = np.array([0,h]).reshape(1,2)

# should be close to 0 if it is partial derivative w.r.t. u
print(g.partial_derivative(arr) - (g.cumulative_distribution(arr + eps1) - g.cumulative_distribution(arr - eps1))/2/h)
# should be close to 0 if it is partial derivative w.r.t. v
print(g.partial_derivative(arr) - (g.cumulative_distribution(arr + eps2) - g.cumulative_distribution(arr - eps2))/2/h)
[0.13765666]
[-7.83406673e-12]
@LiZhongyangLi LiZhongyangLi added bug There is an error in the code that needs to be fixed under discussion Issue is currently being discussed labels Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is an error in the code that needs to be fixed under discussion Issue is currently being discussed
Projects
None yet
Development

No branches or pull requests

1 participant