function [ci] = bootstrp_sci(nboot, bootfun, data, alpha) % BOOTSTRP_SCI - returns the bootstrap standard confidence interval with a probability of type I error of alpha % % Input: % data: is a one dimensional matrix (i.e. a vector of lenth ndata) % alpha: the probability we make a type I error (reject H_0 when in fact it is true) % Output: % ci: the standard confidence interval for bootfun % % Written by: % -- % John L. Weatherwax 2008-02-20 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- if( nargin<4 ) alpha=0.05; end % get the bootstrap samples of the function bootfun: [bootstat] = bootstrp( nboot, bootfun, data ); % get the empirical quantiles of our bootfun (from the bootstrap estimates) ci = quantile( bootstat, [ 0.5*alpha, 1-0.5*alpha ] );