示例#1
0
 def test_trimmedmean(self):
     data = ma.array([
         77, 87, 88, 114, 151, 210, 219, 246, 253, 262, 296, 299, 306, 376,
         428, 515, 666, 1310, 2611
     ])
     assert_almost_equal(mstats.trimmed_mean(data, 0.1), 343, 0)
     assert_almost_equal(mstats.trimmed_mean(data, (0.1, 0.1)), 343, 0)
     assert_almost_equal(mstats.trimmed_mean(data, (0.2, 0.2)), 283, 0)
示例#2
0
 def test_trimmedmeanci(self):
     "Tests the confidence intervals of the trimmed mean."
     data = ma.array([545,555,558,572,575,576,578,580,
                      594,605,635,651,653,661,666])
     assert_almost_equal(ms.trimmed_mean(data,0.2), 596.2, 1)
     assert_equal(np.round(ms.trimmed_mean_ci(data,(0.2,0.2)),1),
                  [561.8, 630.6])
 def test_trimmedmeanci(self):
     "Tests the confidence intervals of the trimmed mean."
     data = ma.array([
         545, 555, 558, 572, 575, 576, 578, 580, 594, 605, 635, 651, 653,
         661, 666
     ])
     assert_almost_equal(ms.trimmed_mean(data, 0.2), 596.2, 1)
     assert_equal(np.round(ms.trimmed_mean_ci(data, (0.2, 0.2)), 1),
                  [561.8, 630.6])