Skip to content
MthwRobinson edited this page Dec 19, 2014 · 1 revision

Bootstrapping

Creating Discrete Distributions from Data

The Bootstrap function performs an infinite bootstrap of a data set. That is to say, each data point is assigned a probability of 1/n, which is the value that would result if the data set were resampled an infinite number of times. The code will bootstrap both symbolic and numeric data points. The numerical data points are arranged in ascending order and the symbolic data points are arranged in alphabetical order. If a data point is observed n times in a data set, it's probability value is given n times the weight of a data point that appears once. The only argument for this procedure is a list of data points.

Syntax

BootstrapRV(data)

Examples:

In [3]: X=NormalRV(2,2)

In [4]: # Generate random variates

In [5]: data=X.variate(n=10)

In [6]: # Create a discrete random variable

In [7]: Xstar=BootstrapRV(data)

In [8]: Xstar.display()
discrete pdf where {x->f(x)}:
{0.949853047183886 -> 0.1},  {0.973186661501865 -> 0.1},  {1.21744254404280 -> 0.1},  {1.41959022960801 -> 0.1},  {1.44081373197995 -> 0.1},  {1.49759172225763 -> 0.1},  {2.54122254749348 -> 0.1},  {3.13641525387803 -> 0.1},  {4.01272100285340 -> 0.1},  {4.89046252614829 -> 0.1}
Clone this wiki locally