44
boot.iid
15
Examples
oopt = ani.options(interval = 0.1, nmax = ifelse(interactive(),
300, 2))
par(mar = rep(0.5, 4))
BM.circle(cex = 2, pch = 19)
saveHTML({
par(mar = rep(0.5, 4), pch = 19)
ani.options(interval = 0.05, nmax = ifelse(interactive(),
100, 10))
BM.circle(cex = 2, pch = 19)
}, img.name = "BM.circle", htmlfile = "BM.circle.html",
ani.height = 450, ani.width = 450, single.opts = paste("controls:",
"[first, previous, play, next, last, loop, speed],",
"delayMin: 0"), title = "Brownian Motion in a Circle",
description = "Brownian Motion in a circle.")
ani.options(oopt)
boot.iid
Demonstrate bootstrapping for iid data
Description
Use a sunflower scatter plot to illustrate the results of resampling, and a histogram to show the
distribution of the statistic of interest.
Usage
boot.iid(x = runif(20), statistic = mean, m = length(x), mat = matrix(1:2, 2),
widths = rep(1, ncol(mat)), heights = rep(1, nrow(mat)), col = c("black", "red",
"bisque", "red", "gray"), cex = c(1.5, 0.8), main, ...)
Arguments
x
anumerical vector (the original data).
statistic
Afunction which returns a value of the statistic of interest when applied to the
data x.
m
the sample size for bootstrapping (m-out-of-n bootstrap)
mat, widths, heights
arguments passed tolayout to set the layout of the two graphs
col
acharacter vector of length 5 specifying the colors of: points of original data,
points for the sunflowerplot, rectangles of the histogram, the density line, and
the rug.
cex
anumeric vector of length 2: magnification of original data points and the sun-
flowerplot points.