% % epage 241 % % bootstrap confinence interval of the mean % % 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. % %----- clear all; close all; clc; addpath('../../Code/CSTool'); load forearm; % get the standard percentile interval for the sample second moment (using the bootstrap): fn = @mean; B = 1500; alpha = 0.1; qhat = bootstrp_sci( B, fn, forearm, alpha ); fprintf( 'the mean for the forearm data = %10.5f:\n', mean(forearm) ); fprintf( 'the empirical bootstrap computed estimates percentile interval are given by:\n' ); fprintf( '%10.5f', qhat ); fprintf('\n'); % get the standard percentile interval for the sample second moment % (using the the known distribution) of the sample mean: mu0 = mean(forearm); % <- assume this is the POPULATION mean nd = length(forearm); % <- the number of samples std0 = std(forearm); % <- assume this is the POPULATION standard deviation meanStd = std0/sqrt(nd); % <- the known standard deviation of the statistic (the mean) qhat = norminv( [ 0.5*alpha, 1-0.5*alpha ], mu0, meanStd ); fprintf( 'the theoretical computed estimates percentile interval are given by:\n' ); fprintf( '%10.5f', qhat ); fprintf('\n');