- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
Latest commit
26 lines (21 loc) · 501 Bytes
/
Copy pathscript.py
File metadata and controls
26 lines (21 loc) · 501 Bytes
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
importsys
fromfunctoolsimportpartial
importnumpyasnp
fromscipy.statsimportbootstrap
N, NUM_REPLICATES= (int(arg) forarginsys.argv[1:])
boot=bootstrap(
data=(np.arange(N, dtype=np.float64),),
statistic=partial(np.var, ddof=1),
n_resamples=NUM_REPLICATES,
method="percentile",
)
print(
"variance: ",
boot.standard_error**2,
"; confidence_interval: (",
boot.confidence_interval.low,
", ",
boot.confidence_interval.high,
")",
sep="",
)