def _draw_bs_reps_mean(data, size=1):
"""
Generate bootstrap replicates of the mean out of `data`.
Parameters
----------
data : array_like
One-dimensional array of data.
size : int, default 1
Number of bootstrap replicates to generate.
Returns
-------
output : float
Bootstrap replicates of the mean computed from `data`.
"""
# Set up output array
bs_reps = np.empty(size)
# Draw replicates
n = len(data)
for i in range(size):
bs_reps[i] = np.mean(np.random.choice(data, size=n))
return bs_reps
评论列表
文章目录