Skip to content
DeepForgeby svx
All problems
HardStatisticsst-094

Bootstrap Bias Estimate

Problem

Estimate the bootstrap bias of the sample mean: draw n_boot resamples with replacement using a self-contained Lehmer RNG seeded with seed (state = seed % 2147483647, next = state * 48271 % 2147483647) and return mean(resample means) - mean(data). Return 0.0 for empty data or n_boot <= 0.

Hint

Bias is the difference between the average bootstrap mean and the observed mean.

Test cases

case 1
in: [[1,2,3,4,5],200,7]
expected: -0.023000000000000576
case 2
in: [[5],50,1]
expected: 0
case 3
in: [[],10,1]
expected: 0
case 4
in: [[1,2],100,3]
expected: 0.03499999999999992
case 5
in: [[10,20,30,40],300,99]
expected: -0.31666666666666643
Starter codePython
def bootstrap_bias(data, n_boot, seed):
    # Your code here
    pass

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