def down_capture(self, benchmark, threshold=0.0, compare_op="lt"):
        """Downside capture ratio.

        Measures the performance of `self` relative to benchmark
        conditioned on periods where `benchmark` is lt or le to
        `threshold`.

        Downside capture ratios are calculated by taking the fund's
        monthly return during the periods of negative benchmark
        performance and dividing it by the benchmark return.
        [Source: CFA Institute]

        Parameters
        ----------
        benchmark : {pd.Series, TSeries, 1d np.ndarray}
            The benchmark security to which `self` is compared.
        threshold : float, default 0.
            The threshold at which the comparison should be done.
            `self` and `benchmark` are "filtered" to periods where
            `benchmark` is lt/le `threshold`.
        compare_op : {'lt', 'le'}
            Comparison operator used to compare to `threshold`.
            'lt' is less-than; 'le' is less-than-or-equal.

        Returns
        -------
        float

        Note
        ----
        This metric uses geometric, not arithmetic, mean return.
        """

        slf, bm = self.downmarket_filter(
            benchmark=benchmark,
            threshold=threshold,
            compare_op=compare_op,
            include_benchmark=True,
        )
        return slf.geomean() / bm.geomean()
def down_capture ( self , benchmark , threshold = 0.0 , compare_op = "lt" ) : slf , bm = self . downmarket_filter ( benchmark = benchmark , threshold = threshold , compare_op = compare_op , include_benchmark = True , ) return slf . geomean ( ) / bm . geomean ( )
Downside capture ratio.

        Measures the performance of `self` relative to benchmark
        conditioned on periods where `benchmark` is lt or le to
        `threshold`.

        Downside capture ratios are calculated by taking the fund's
        monthly return during the periods of negative benchmark
        performance and dividing it by the benchmark return.
        [Source: CFA Institute]

        Parameters
        ----------
        benchmark : {pd.Series, TSeries, 1d np.ndarray}
            The benchmark security to which `self` is compared.
        threshold : float, default 0.
            The threshold at which the comparison should be done.
            `self` and `benchmark` are "filtered" to periods where
            `benchmark` is lt/le `threshold`.
        compare_op : {'lt', 'le'}
            Comparison operator used to compare to `threshold`.
            'lt' is less-than; 'le' is less-than-or-equal.

        Returns
        -------
        float

        Note
        ----
        This metric uses geometric, not arithmetic, mean return.