Bootstrapping Confidence Intervals
Start Timer
0:00:00
You are given an array of numerical values, bootstrap samples, and size for a confidence interval.
Write a function that performs bootstrap sampling on the given array and calculates the confidence interval based on the given size.
Note: The function should return a tuple containing the minimum and maximum values of the confidence interval rounded to the tenths place.
Example
Input:
values = [1, 2, 3, 4, 5]
Output
bootstrap_conf_interval(values, 1000, 0.95) -> (1.2, 4.8)
In this case, the function returns a tuple indicating that we are 95% confident that the population parameter lies between 1.2 and 4.8 based on our bootstrap samples.
Note: Results may vary due to the randomness of bootstrap sampling.
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments