Skip to content

Wrong get_pdf formula for Gaussian copula #11

@shudabee

Description

@shudabee

In the pdf computation for Gaussian copula, the formula in the last row is wrong.
def get_pdf(self, u, v, param):
"""
# Computes the PDF

    Parameters
    ----------
    u, v : float
        Values of the marginal CDFs 
    param : list
        The correlation coefficient param[0] ∈ [-1,1].
        Used to defined the correlation matrix (squared, symetric and definite positive)
    """
    
    rho = param[0]
    a = np.sqrt(2) * erfinv(2 * u - 1)
    b = np.sqrt(2) * erfinv(2 * v - 1)
    det_rho = 1 - rho**2
    
    return det_rho**-0.5 * np.exp(-((a**2 + b**2) * rho**2 -2 * a * b * rho) / (2 * det_rho))

it should be 1/(2 * np.pi * np.sqrt(det_rho)) * np.exp(-((a2 + b2) * rho**2 -2 * a * b * rho) / (2 * det_rho))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions