Esempio n. 1
0
 def test_collate_effect_size_2_power(self):
     # The known effect is used as a reference elsewhere
     test_means, test_bounds = collate_effect_size(counts=self.counts,
                                                   powers=self.power2,
                                                   alpha=self.alpha)
     npt.assert_almost_equal(self.effects, test_means, 4)
     npt.assert_almost_equal(self.bounds, test_bounds, 4)
Esempio n. 2
0
 def test_collate_effect_size_2_power(self):
     # The known effect is used as a reference elsewhere
     test_means, test_bounds = collate_effect_size(counts=self.counts,
                                                   powers=self.power2,
                                                   alpha=self.alpha)
     npt.assert_almost_equal(self.effects, test_means, 4)
     npt.assert_almost_equal(self.bounds, test_bounds, 4)
Esempio n. 3
0
 def test_collate_effect_size_1_power(self):
     known_means = np.array([0.72374193, 0.5795861])
     known_bounds = np.array([0.17654622, 0.06264818])
     test_means, test_bounds = collate_effect_size(counts=self.counts,
                                                   powers=self.power1,
                                                   alpha=self.alpha)
     npt.assert_almost_equal(known_means, test_means, 4)
     npt.assert_almost_equal(known_bounds, test_bounds, 4)
Esempio n. 4
0
 def test_collate_effect_size_1_power(self):
     known_means = np.array([0.72374193, 0.5795861])
     known_bounds = np.array([0.17654622, 0.06264818])
     test_means, test_bounds = collate_effect_size(counts=self.counts,
                                                   powers=self.power1,
                                                   alpha=self.alpha)
     npt.assert_almost_equal(known_means, test_means, 4)
     npt.assert_almost_equal(known_bounds, test_bounds, 4)
Esempio n. 5
0
    def test_collate_effect_size_nan(self):
        power = [count * 0 for count in self.counts]

        test_mean, test_bounds = collate_effect_size(counts=self.counts,
                                                     powers=power,
                                                     alpha=self.alpha)

        self.assertTrue(np.isnan(test_mean[0]))
        self.assertTrue(np.isnan(test_bounds[0]))
Esempio n. 6
0
    def test_collate_effect_size_nan(self):
        power = [count*0 for count in self.counts]

        test_mean, test_bounds = collate_effect_size(counts=self.counts,
                                                     powers=power,
                                                     alpha=self.alpha)

        self.assertTrue(np.isnan(test_mean[0]))
        self.assertTrue(np.isnan(test_bounds[0]))
Esempio n. 7
0
 def test_collate_effect_size_count_for_power_2d(self):
     with self.assertRaises(ValueError):
         collate_effect_size(counts=[self.counts[0]],
                             powers=self.power2[1],
                             alpha=0.05)
Esempio n. 8
0
 def test_collate_effect_size_count_shape_error(self):
     with self.assertRaises(TypeError):
         collate_effect_size(counts=self.power2,
                             powers=self.power2,
                             alpha=self.alpha)
Esempio n. 9
0
 def test_collate_effect_size_unequal_counts_error(self):
     with self.assertRaises(ValueError):
         collate_effect_size(counts=[np.array([1, 2, 3])],
                             powers=self.power2,
                             alpha=self.alpha)
Esempio n. 10
0
 def test_collate_effect_size_count_for_power_2d(self):
     with self.assertRaises(ValueError):
         collate_effect_size(counts=[self.counts[0]],
                             powers=self.power2[1],
                             alpha=0.05)
Esempio n. 11
0
 def test_collate_effect_size_count_shape_error(self):
     with self.assertRaises(TypeError):
         collate_effect_size(counts=self.power2,
                             powers=self.power2,
                             alpha=self.alpha)
Esempio n. 12
0
 def test_collate_effect_size_unequal_counts_error(self):
     with self.assertRaises(ValueError):
         collate_effect_size(counts=[np.array([1, 2, 3])],
                             powers=self.power2,
                             alpha=self.alpha)