Thursday, June 3, 2010

Bootstrap Estimate of Standard Error and Bias

Bootstrapping is a method similar to Monte Carlo with one difference. Instead of sampling from a theoretical population distribution, we are sampling from the data (random sample) with replacement.

For example, the following code calculate the skewness of forearm.

load forearm
theta = skewness(forearm);


Now we want to find out what is the standard error (same as the standard deviation) of this measurement? Notice that this is not the standard deviation of the data. The bootstrap resampling process is as follow

load forearm
theta = skewness(forearm);
n=length(forearm);
B=100; % how many bootstrap replicates
inds=unidrnd(n,n,B); % nxB
xboot=forearm(inds); % nxB
thetaB=skewness(xboot);
seB=std(thetaB);

>> seB
seB =
    0.1498

Or we can directly use MATLAB bootstrap function

Bmat = bootstrp(B,'skewness',forearm);
seBmat = std(Bmat);

>> seBmat
seBmat =
    0.1493


Efron and ibshirani [1993] suggested that, taking more than 200 bootstrap replicates to estimate the standard error is unnecessary.

Now, for the bias, the bootstrap estimate can easily calculate as.

meanB = mean(thetaB);
biasB = meanB - theta;

>> biasB
biasB =
   -0.0075


E&T also recommended $B\ge400$.

No comments:

Post a Comment