% % problem 268 % example epage 250 % % 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'); x = [ 58, 67, 74, 74, 80, 89, 95, 97, 98, 107 ]; n = length(x); T = mean(x); % compute the bootstrapped standard error (of the momiance): B = 10000; [m] = bootstrp( B, @mean, x ); bts_stderr = std(m); bts_bias = mean(m)-T; % compute the jackknifed estimate standard eor (of the momiance): jack = zeros(1,n); % <- store the jackknifed samples for ii=1:n jack(ii) = mean( x( setdiff(1:n,ii) ) ); end % get the mean of the jackknifed estimates TJ = mean(jack); jackBias = (n-1)*(TJ-T); jackEstStdError = sqrt( ((n-1)/n)*sum( ( jack - TJ ).^2 ) ); fprintf( 'The bootstrap estimated standard error is given by %10.5f\n', bts_stderr ); fprintf( 'The bootstrap estimated bias is given by %10.5f\n', bts_bias ); fprintf( 'The jackknifed estimated standard error is given by %10.5f\n', jackEstStdError ); fprintf( 'The jackknifed estimated bias is given by %10.5f\n', jackBias );