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

Wrong in annotation section of 'partial-derivative method' in copulas\bivariate\base.py, IT should be F(u|v) not F(v|u) #444

Open
zhxuhan opened this issue Dec 29, 2024 · 0 comments
Labels
bug There is an error in the code that needs to be fixed new Automatic label applied to new issues

Comments

@zhxuhan
Copy link

zhxuhan commented Dec 29, 2024

def partial_derivative(self, X):
    r"""Compute partial derivative of cumulative distribution.

    The partial derivative of the copula(CDF) is the conditional CDF.

    _ORIGINAL: .. math:: **F(v|u) = \frac{\partial C(u,v)}{\partial u}**_
    _CORRECTED.. math:: **F(u|v) = \frac{\partial C(u,v)}{\partial v}**_
    The base class provides a finite difference approximation of the
    partial derivative of the CDF with respect to u.

    Args:
        X(np.ndarray)
        y(float)

    Returns:
        np.ndarray

    """
    delta = 0.0001 * (-2 * (X[:, 1] > 0.5) + 1)
    X_prime = X.copy()
    X_prime[:, 1] += delta
    f = self.cumulative_distribution(X)
    f_prime = self.cumulative_distribution(X_prime)
    return (f_prime - f) / delta
@zhxuhan zhxuhan added bug There is an error in the code that needs to be fixed new Automatic label applied to new issues labels Dec 29, 2024
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 new Automatic label applied to new issues
Projects
None yet
Development

No branches or pull requests

1 participant