Page 230 - Computational Statistics Handbook with MATLAB
P. 230
Chapter 6: Monte Carlo Methods for Inferential Statistics 217
a small value of B, say B = 25 , the analyst will gain information about the
θ
ˆ
variability of . In most cases, taking more than 200 bootstrap replicates to
estimate the standard error is unnecessary.
The procedure for finding the bootstrap estimate of the standard error is
given here and is illustrated in Example 6.9
PROCEDURE - BOOTSTRAP ESTIMATE OF THE STANDARD ERROR
ˆ
,
,
1. Given a random sample, x = ( x 1 … x n ) , calculate the statistic . θ
2. Sample with replacement from the original sample to get
,
* b
x * b = ( x , … x * b . )
n
1
3. Calculate the same statistic using the sample in step 2 to get the
bootstrap replicates, θ ˆ *b .
4. Repeat steps 2 through 3, B times.
ˆ
θ
5. Estimate the standard error of using Equations 6.14 and 6.15.
Example 6.9
The lengths of the forearm (in inches) of 140 adult males are contained in the
file forearm [Hand, et al., 1994]. We use these data to estimate the skewness
of the population. We then estimate the standard error of this statistic using
the bootstrap method. First we load the data and calculate the skewness.
load forearm
% Sample with replacement from this.
% First get the sample size.
n = length(forearm);
B = 100;% number of bootstrap replicates
% Get the value of the statistic of interest.
theta = skewness(forearm);
The estimated skewness in the forearm data is -0.11. To implement the boot-
strap, we use the MATLAB Statistics Toolbox function unidrnd to sample
with replacement from the original sample. The corresponding function from
the Computational Statistics Toolbox can also be used. The output from this
function will be indices from 1 to n that point to what observations have been
selected for the bootstrap sample.
% Use unidrnd to get the indices to the resamples.
% Note that each column corresponds to indices
% for a bootstrap resample.
inds = unidrnd(n,n,B);
% Extract these from the data.
xboot = forearm(inds);
% We can get the skewness for each column using the
% MATLAB Statistics Toolbox function skewness.
© 2002 by Chapman & Hall/CRC