Volume 9, Issue 4
Tricks of the Trade
In and Out
Download This Issue
Staff and Contributors
Unfortunately, in most cases we do not know the underlying distribution from which the sample is drawn. At best we may suspect that the true distribution is in some family of distributions, but we generally do not know the parameters of the distribution. If we did, we could just apply the theoretical formulas and be done with it.
So suppose that we have just one sample. Is there any way to use that one sample to compute an estimate of the sampling distribution of a statistic? This is where the bootstrap comes in.
The idea is to repeatedly sample (with replacement) from the single sample you have, and use these "samples" to compute the sampling distribution of the statistic in which you are interested. In the previous Monte Carlo exercise, we drew a "fresh" sample each time; in the bootstrap case, we resample from the single sample that we have. Other than that difference, the procedures are essentially the same. If our original sample is reasonably representative of the population, then resampling from that sample should look pretty much like drawing a new sample.
The remarkable thing about the bootstrap is that even though we only have a single sample, it can often be used to give a quite good estimate of what would happen if we really were able to draw new, fresh samples.
Here is a function that will resample (with replacement) from a list.
To make sure it works, we will try it on a test list.
Here is a fixed random sample of 25 numbers.
Now we will resample from this fixed sample 5000 times and look at this distribution of estimated means.
About Mathematica | Download Mathematica Player
© Wolfram Media, Inc. All rights reserved.