diff --git a/README.html b/README.html index fb8d155..387e1a3 100644 --- a/README.html +++ b/README.html @@ -4,12 +4,12 @@
-The goal is both to offer a quick reference for new and old users and to @@ -949,7 +949,20 @@ the rows which only contain integers and which sum to n. (★★★)
print(X[M]) +Compute bootstrapped 95% confidence intervals for the mean of a 1D array X (i.e., resample the elements of an array with replacement N times, compute the mean of each sample, and then compute percentiles over the means).
+++# Author: Jessica B. Hamrick + +N = 1000 # number of bootstrap samples +idx = np.random.randint(0, X.size, (N, X.size)) +means = X[idx].mean(axis=1) +confint = np.percentile(means, [2.5, 97.5]) +print(confint) ++