bootstrap
.
samp.boot.mc(n, B) samp.boot.bal(n, B) samp.permute(n, B)
n
will be generated from the vector 1:n.
These functions are examples of samplers suitable for
bootstrap
.
They produce a matrix of resamples from a specified vector.
Each column is one set of resamples.
samp.boot.mc
provides simple Monte Carlo resamples.
samp.boot.bal
does balanced resampling in which each observation appears
exactly
B
times in the result.
samp.permute
returns
B
columns of random permutations of 1:n.
These samplers are typically called multiple times by
bootstrap
,
to generate indices for a block of say
B=100
replications at a time;
the value of
B
here corresponds to the
block.size
argument to
bootstrap
.
For balanced bootstrapping the individual samples are
n
values generated with replacement (from a vector of length
nB
).
This produces biased results, of order
O(1/B)
,
and tends to underestimate bootstrap standard errors
and produce confidence intervals which are too narrow.
samp.boot.mc(4, 2)