Exemple #1
0
def test_confinterval_array_mean():
    assert pytest.approx(
        labmath.confinterval([1, 2, 3], conf=0.5, array_mean=2),
        (1.528595479208968, 2.4714045207910322))
    assert pytest.approx(
        labmath.confinterval([1, 2, 3], conf=0.5, array_mean=1),
        (0.528595479209, 1.47140452079))
Exemple #2
0
 def test_confinterval_array_mean(self):
     self._test((1.528595479208968, 2.4714045207910322),
                labmath.confinterval([1,2,3], conf=0.5, array_mean=2))
     expected_ci = (0.528595479209, 1.47140452079)
     actual_ci = labmath.confinterval([1,2,3], conf=0.5, array_mean=1)
     self._test(expected_ci[0], actual_ci[0], approximate=True)
     self._test(expected_ci[0], actual_ci[0], approximate=True)
Exemple #3
0
 def test_confinterval_error_only(self):
     self._test(0.4714045207910322, labmath.confinterval([1,2,3], conf=.5,
                                                         error_only=True),
                approximate=True)
Exemple #4
0
 def test_confinterval_normal_dist(self):
     self._test((0.86841426592382809, 3.1315857340761717),
                labmath.confinterval([1,2,3], normal_threshold=1))
Exemple #5
0
 def test_confinterval_c50(self):
     self._test((1.528595479208968, 2.4714045207910322),
                labmath.confinterval([1,2,3], conf=0.5))
Exemple #6
0
 def test_confinterval_all_same(self):
     self._test((1, 1),
                labmath.confinterval([1,1,1,1,1]))
Exemple #7
0
 def test_confinterval_123_array(self):
     self._test((-0.48413771184375287, 4.4841377118437524),
                labmath.confinterval([1,2,3]))
Exemple #8
0
 def test_confinterval_single_item_array(self):
     self._test((1, 1), labmath.confinterval([1]))
Exemple #9
0
 def test_confinterval_empty_array(self):
     self._test((0, 0), labmath.confinterval([]))
Exemple #10
0
def test_confinterval_error_only():
    assert pytest.approx(
        labmath.confinterval([1, 2, 3], conf=.5, error_only=True),
        0.47140452079103223)
Exemple #11
0
def test_confinterval_normal_dist():
    assert ((0.86841426592382809,
             3.1315857340761717) == labmath.confinterval([1, 2, 3],
                                                         normal_threshold=1))
Exemple #12
0
def test_confinterval_c50():
    assert ((1.528595479208968,
             2.4714045207910322) == labmath.confinterval([1, 2, 3], conf=0.5))
Exemple #13
0
def test_confinterval_all_same():
    assert ((1, 1) == labmath.confinterval([1, 1, 1, 1, 1]))
Exemple #14
0
def test_confinterval_123_array():
    assert labmath.confinterval([1, 2, 3]) == (-0.48413771184375287,
                                               4.4841377118437524)
Exemple #15
0
def test_confinterval_single_item_array():
    assert (1, 1) == labmath.confinterval([1])
Exemple #16
0
def test_confinterval_empty_array():
    assert (0, 0) == labmath.confinterval([])