Skip to content

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

@zhxuhan

Description

@zhxuhan
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThere is an error in the code that needs to be fixednewAutomatic label applied to new issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions