smoothedBootstrap(data, statistic, B = 1000, args.stat, sampler = samp.bootstrap, seed = .Random.seed, smoother = rmvnorm, args.smoother = list(cov = as.matrix(var(data))/numRows(data), d = numCols(data)), label, statisticNames, block.size = min(100, B), trace = resampleOptions()$trace, assign.frame1 = F, save.samples = F, statistic.is.random, seed.statistic = 500)
args.stat
.
mean(x,trim=.2)
.
If
data
is given by name (e.g.
data=x
) then use that name
in the expression,
otherwise (e.g.
data=air[,4]
) use the name
data
in the expression.
If
data
is a data frame, the expression may involve variables
in the data frame.
statistic
when calculating
the statistic on the resamples.
set.seed
.
sampler
), in effect sampling from a smoothed empirical distribution.
smoother
when performing the
smoothing of the resamples.
smoothedBootstrap
calls
,
which uses nested
for()
loops;
generally, the inner loop runs
block.size
times.
assign.frame1=T
if all estimates are identical (this is slower).
smoothedBootstrap
which inherits from
resamp
. This has
components
call
,
observed
,
replicates
,
estimate
,
B
,
n
,
dim.obs
,
seed.start
,
seed.end
,
parent.frame
,
defaultLabel
,
and possibly
label
.
The data frame
estimate
has
three columns containing the bootstrap estimates of
Bias
,
Mean
, and
SE
.
See
for a description of many components.
assign.frame1=T
, you must be sure that this assignment does not
overwrite some quantity of interest stored in frame 1.
If the function is interrupted it saves current results
(all complete sets of
block.size
replicates)
to
.smoothedBootstrap.partial.results
(and also over-writes
.parametricBootstrap.partial.results
).
This object is nearly the same as if
smoothedBootstrap
were called with a smaller value of
B
.
Performs smoothed bootstrapping for a wide range of
statistics and expressions. Observations are first selected, with
replacement, from the original data. This is done using the
sampler
function, in the same way as is done in
bootstrap
.
Observations are then smoothed by adding a random variable
generated by the
smoother
.
This corresponds to convolving the empirical distribution
function with a kernel corresponding to
smoother
.
This is implemented by creating a composite sampling function
which is passed to
.
This version uses a lot of memory, and time.
It may at some point be replaced by a version
which calls
bootstrap
, with a front end that modifies the
statistic to add the right amount of noise to the data before
calculating the real statistic. However, many of the functions that
currently accept
"bootstrap"
objects as input should not be used
in that case, because they require that the statistic be (nearly)
deterministic.
Data sets (arrays) of dimension higher than 2 may not be passed to
smoothedBootstrap
.
Davison, A.C. and Hinkley, D.V. (1997), Bootstrap Methods and Their Application, Cambridge University Press.
Hesterberg, T.C. (2004), "Unbiasing the Bootstrap - Bootknife Sampling vs. Smoothing", Proceedings of the Section on Statistics and the Environment, American Statistical Association, pp. 2924-2930.
More details on some arguments, see .
Print, summarize, plot: , , , , ,
Description of an "smoothedBootstrap" object, extract parts: , .
Confidence intervals: , .
Modify an "smoothedBootstrap" object: , .
For an annotated list of functions in the package, including other high-level resampling functions, see: .
# compare the cdf of the smoothedBootstrap replicates to that of # the bootstrap replicates -- smoothedBootstrap's is smooth # by comparison boot.stack <- bootstrap(stack.loss, median) sboot.stack <- smoothedBootstrap(stack.loss, median) cdf.compare(boot.stack$replicates, sboot.stack$replicates)