Description Usage Arguments Details Value Note Author(s) References See Also
Use a sunflower scatter plot to illustrate the results of resampling, and a histogram to show the distribution of the statistic of interest.
1 2 3 4 5 6 7 8 9 10 11 12 |
x |
a numerical vector (the original data). |
statistic |
A function 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 to |
col |
a character 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 |
a numeric vector of length 2: magnification of original data points and the sunflowerplot points. |
main |
a character vector of length 2: the main titles of the two graphs. |
... |
other arguments passed to |
This is actually a very naive version of bootstrapping but may be useful for novices. By default, the circles denote the original dataset, while the red sunflowers (probably) with leaves denote the points being resampled; the number of leaves just means how many times these points are resampled, as bootstrap samples with replacement. The x-axis is the sample values, and y-axis is the indices of sample points.
The whole process has illustrated the steps of resampling, computing the statistic and plotting its distribution based on bootstrapping.
A list containing
t0 |
The observed value of 'statistic' applied to 'x'. |
tstar |
Bootstrap versions of the 'statistic'. |
The maximum times of resampling is specified in
ani.options('nmax')
.
Yihui Xie
Examples at https://yihui.org/animation/example/boot-iid/
There are many references explaining the bootstrap and its variations.
Efron, B. and Tibshirani, R. (1993) An Introduction to the Bootstrap. Chapman & Hall.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.