Question: Implement a bootstrap_ci function to calculate the confidence interval of any sample statistic (in this case the mean). The function should take a sample, a
Implement a bootstrap_ci function to calculate the confidence interval of any sample statistic (in this case the mean). The function should take a sample, a function that computes the sample statistic, the number of resamples (default: 10000), and the confidence level (default: 0.95). The function should return the lower and upper bounds of the confidence interval and the bootstrap distribution of the sample statistic. You should be able to call the function in the following manner: bootstrap_ci(sample, stat_function=np.mean, resamples=1000, ci=95)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
