INNER CODE UNIT · Python

xi

sdv-dev/Copulas · copulas/optimize/__init__.py:128

        xi = (a - b) / (c - b)
        phi = (fa - fb) / (fc - fb)
        iqi = np.logical_and(phi**2 < xi, (1 - phi) ** 2 < 1 - xi)

        if not shape:
            # scalar case
            if iqi:
                # inverse quadratic interpolation
                eq1 = fa / (fb - fa) * fc / (fb - fc)
                eq2 = (c - a) / (b - a) * fa / (fc - fa) * fb / (fc - fb)
                t = eq1 + eq2
            else:
                # bisection
                t = 0.5
        else:
            # array case
            t = np.full(shape, 0.5)
            a2, b2, c2, fa2, fb2, fc2 = a[iqi], b[iqi], c[iqi], fa[iqi], fb[iqi], fc[iqi]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…