Skip to content
DeepForgeby svx
All problems
HardStatisticsst-135

Block Bootstrap Standard Error

Problem

Return the block bootstrap standard error of the mean: split data into non-overlapping blocks of length block_len, resample the blocks with replacement using the seeded Lehmer RNG, and return the population standard deviation of the resample means. Return 0.0 when data is empty, n_boot <= 0, or block_len is not in [1, n].

Hint

Whole blocks preserve short-range dependence.

Test cases

case 1
in: [[1,2,3,4,5,6],2,200,7]
expected: 0.9854440623394105
case 2
in: [[1,2,3,4,5],2,300,42]
expected: 0.6925315877272313
case 3
in: [[5,5,5,5],2,100,1]
expected: 0
case 4
in: [[1,2,3],5,100,1]
expected: 0
case 5
in: [[],2,100,1]
expected: 0
Starter codePython
def block_bootstrap_se(data, block_len, n_boot, seed):
    # Your code here
    pass

5 test cases · run your code against them in the editor