Estimate a percentile bootstrap confidence interval for the mean of a sample. Draw B resamples of the same size with replacement using np.random.default_rng(seed), take each resample's mean, and return the alpha/2 and 1 - alpha/2 quantiles of those means.
Implement solve(x, B=1000, alpha=0.05, seed=0).
Returns. Return a tuple (low, high) of Python floats. Quantiles use NumPy's default linear interpolation.
Example 1
Input:
solve([1.0, 2.0, 3.0, 4.0])
Output:
(1.5, 3.5)
Example 2
Input:
solve([5.0, 5.0, 5.0])
Output:
(5.0, 5.0)
Example 3
Input:
solve([1.0, 2.0, 3.0, 4.0, 10.0], B=500, alpha=0.1, seed=7)
Output:
(2.0, 6.8)
No results yet
Run your code to check it against the examples, or submit to run every test.