def test_bootstrap_difference_and_fdr(self):
        # Generate reference data
        np.random.seed(31415)
        x, var0 = self.generate_data()
        a = cs.bootstrap_connectivity('PDC', x, VAR(2), nfft=4, repeats=100)

        # Similar to reference data ==> no significant differences expected
        np.random.seed(12345)
        x, var0 = self.generate_data()
        b = cs.bootstrap_connectivity('PDC', x, VAR(2), nfft=4, repeats=100)
        p = cs.test_bootstrap_difference(a, b)
        self.assertFalse(np.any(p < 0.01))  # TODO: np.all?
        self.assertFalse(np.any(cs.significance_fdr(p, 0.05)))  # TODO: np.all?

        # Trials rearranged ==> no significant differences expected
        np.random.seed(12345)
        x, var0 = self.generate_data()
        b = cs.bootstrap_connectivity('PDC', x[::-1, :, :], VAR(2), nfft=4,
                                      repeats=100)
        p = cs.test_bootstrap_difference(a, b)
        self.assertFalse(np.any(0.01 < p))
        self.assertFalse(np.any(cs.significance_fdr(p, 0.05)))

        # Channels rearranged ==> highly significant differences expected
        np.random.seed(12345)
        x, var0 = self.generate_data()
        b = cs.bootstrap_connectivity('PDC', x[1, ::-1, :], VAR(2), nfft=4,
                                      repeats=100)
        p = cs.test_bootstrap_difference(a, b)
        self.assertTrue(np.all(p < 0.0001))
        self.assertTrue(np.all(cs.significance_fdr(p, 0.01)))

        # Time reversed ==> highly significant differences expected
        np.random.seed(12345)
        x, var0 = self.generate_data()
        b = cs.bootstrap_connectivity('PDC', x[1, :, ::-1], VAR(2), nfft=4,
                                      repeats=100)
        p = cs.test_bootstrap_difference(a, b)
        self.assertTrue(np.all(p < 0.0001))
        self.assertTrue(np.all(cs.significance_fdr(p, 0.01)))
dataset/ETHPy150Open scot-dev/scot/scot/tests/test_statistics.py/TestFunctions.test_bootstrap_difference_and_fdr/swapped operands of `<`