-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathblb_implementations.py
52 lines (35 loc) · 1.08 KB
/
blb_implementations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import math
from blb import *
def mean(sample):
return sum(sample)*1.0/len(sample)
def stddev(sample):
mn = mean(sample)
return math.sqrt(sum([(x-mn)*(x-mn) for x in sample])*1.0/(len(sample)-1))
class MeanMean_BLB(BLB):
def compute_estimate(self, sample):
return mean(sample)
def reduce_bootstraps(self, sample):
return mean(sample)
def average(self, sample):
return mean(sample)
class SDMean_BLB(BLB):
def compute_estimate(self, sample):
return mean(sample)
def reduce_bootstraps(self, sample):
return stddev(sample)
def average(self, sample):
return mean(sample)
class MeanSD_BLB(BLB):
def compute_estimate(self, sample):
return stddev(sample)
def reduce_bootstraps(self, sample):
return mean(sample)
def average(self, sample):
return mean(sample)
class SDSD_BLB(BLB):
def compute_estimate(self, sample):
return stddev(sample)
def reduce_bootstraps(self, sample):
return stddev(sample)
def average(self, sample):
return mean(sample)