stat_utils.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:saapy 作者: ashapochka 项目源码 文件源码
def draw_bs_pairs(x, y, func, size=1):
    """Perform pairs bootstrap for single statistic."""

    # Set up array of indices to sample from
    inds = np.arange(len(x))

    # Initialize replicates
    bs_replicates = np.empty(size)

    # Generate replicates
    for i in range(size):
        bs_inds = np.random.choice(inds, len(inds))
        bs_x, bs_y = x[bs_inds], y[bs_inds]
        bs_replicates[i] = func(bs_x, bs_y)

    return bs_replicates
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号