function [bootstat, bootsam] = parm_bootstrap(nboot, bootfun, data) % PARM_BOOTSTRAP - one dimensional normal (gaussian) parametric bootstrap samples % % Input: % data: is a one dimensional matrix (i.e. a vector of lenth ndata) % Output: % bootstat: a one dimensional matrix (a vector of length nboot) % bootsam: the bootstrap samples used (a matrix of size [ndata,nboot]) % % 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. % %----- % get the number of data points: ndata = length(data); % estimate the population mean: mu = mean( data ); % estimate the population standard deviation: st = std( data ); % draw "nboot" bootstrap samples from the above hypothesized (a Gaussian) density: bootsam = normrnd(mu,st,ndata,nboot); % evaluate our "bootfun" on these samples (assume the function operates down COLUMNS): bootstat = bootfun( bootsam );