mboot | R Documentation |
Generate R
bootstrap replicates of the given statistic
applied to the data
.
Sampling can be done with or without replacement.
The subsample size m can either be chosen directly or estimated with estimate.m()
.
mboot(data, statistic, m, R = 1000, replace = FALSE, ...)
data |
The data to be bootstrapped. If it is multidimensional, each row is considered as one observation passed to the |
statistic |
A function returing the statistic of interest. It must take two arguments. The first argument passed will be the original data, the second
will be a vector of indicies. Any further arguments can be passed through the |
m |
The subsampling size. |
R |
The number of bootstrap replicates. |
replace |
Whether sampling should be done with replacement or without replacement (the default). |
... |
Additional parameters to be passed to the |
m
needs to be a numeric value meeting the condition 2<=m<=n
.
It must be chosen such that m goes to infinity as n goes to infinits,
but the ratio m/n must go to zero.
The m-out-of-n Bootstrap without replacement, known as subsampling, was introduced by Politis and Romano (1994).
The returned value is an object of the class "mboot"
containing the following components:
t0: The observed value of statistic
applied to the data
.
t: A matrix with R
rows where each is a bootstrap replicate of the result of calling statistic
.
m,n: Selected subsample size and data size.
data: The data
passed to mboot
.
statistic: The statistic
passed to mboot
.
replace: Whether the bootstrap replicates were done with or without replacement.
Politis D.N. and Romano J.P. (1994) Large sample confidence regions based on subsamples under minimal assumptions. The Annals of Statistics, 22(4):2031-2050, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1176325770")}
mboot.ci estimate.m estimate.tau
data <- runif(1000)
estimate.max <- function(data, indices) {return(max(data[indices]))}
boot.out <- mboot(data, estimate.max, R = 1000, m = 2*sqrt(NROW(data)), replace = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.