I have calculated the empirical distribution of the sample mean using the bootstrap method, but now I would also need to calculate the confidence interval for the population mean using the empirical distribution I found.
Is there a way to do it automatically in Matlab given my state? If not, how would you find the 95% confidence interval for population mean?
The bootstrapped confidence intervals for the mean as you have calculated it are the quantiles of the distribution. So, it can be as simple as
That will give a 90% confidence interval for the vector
myBootstrappedMeans
. For reference, http://math.usask.ca/~longhai/doc/talks/slide-bootstrap.pdf0.05 and 0.95 are for the 90% confidence interval (the middle 90% of the data). For a different confidence interval, you would just need to choose the middle quantiles of that data. So, for 95% you would use 0.025 and 0.975. To generalize, you would use
(1-level)/2
and(0.5 + level/2)
wherelevel
is the confidence interval (or confidence level) that you want.