INNER CODE UNIT · Python

phi

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

        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]
            t[iqi] = fa2 / (fb2 - fa2) * fc2 / (fb2 - fc2) + (c2 - a2) / (b2 - a2) * fa2 / (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…