예제 #1
0
 def test_args(self):
     # It should be possible to specify a frozen distribution or a name and
     # parameters.
     assert simple_test((.2, .5, .8), uniform(1, 2)).pvalue == 0
     assert simple_test((.2, .5, .8), 'uniform', args=(1, 2)).pvalue == 0
예제 #2
0
 def test_args(self):
     # It should be possible to specify a frozen distribution or a name and
     # parameters.
     assert simple_test((.2, .5, .8), uniform(1, 2)).pvalue == 0
     assert simple_test((.2, .5, .8), 'uniform', args=(1, 2)).pvalue == 0
예제 #3
0
 def test_basic(self):
     # Custom statistic calculation / distribution and object-like result.
     stat = lambda data: 3
     pdist = lambda samples: namedtuple('FD', 'sf')(sf=lambda statistic: .5)
     result = simple_test((1, 2, 3), norm, stat=stat, pdist=pdist)
     assert result.statistic == 3 and result.pvalue == .5
예제 #4
0
 def test_basic(self):
     # Custom statistic calculation / distribution and object-like result.
     stat = lambda data: 3
     pdist = lambda samples: namedtuple('FD', 'sf')(sf=lambda statistic: .5)
     result = simple_test((1, 2, 3), norm, stat=stat, pdist=pdist)
     assert result.statistic == 3 and result.pvalue == .5