The pull-out method belongs to the repeated sampling (resampling) method, which differs from the Monte Carlo in the real matrix. It is the repeated sampling of the observed values as the mother,
In order to obtain the information characteristics which are less than two of the original data cannot be explored.
For example, assuming that x1,x2,..., xn as an observation from the same allocation, we would like to know the median of this allocation.
Set up a group of random samples with Poisson allocation, 6 7 7 7 7 8 ... 15 15 17 20, a total of 30. The median number of known samples is 10.
Here we use the MC method and the Bootstrap method to simulate 10,000 times, the distribution of the median number.
# Monte Carlot1 = nullfor (i in 1:10000) { X1=rpois (30,10); Y1=median (x1); T1=c (t1,y1)}# Bootstrapt2 = NULLx0 = Rpois (30, (i in 1:10000) { x2=sample (x0,30,t); Y2=median (x2); T2=c (t2,y2)}par (mfrow=c) hist (T1,xlab = "median", Main = "Monte Carlo") hist (T2,xlab = "Median", main = "Bootstrap")
Output:
After testing the difference between the two standards, found that the difference is not large:
The implementation of--bootstrap--r language by pulling Boots method