Description Usage Arguments Details Value Examples
Implements Bag of Little Bootstraps on a 1-d data vector. The statistic which is bootstrapped is the mean, with the exception of BLB_R, which can accept a generic function as the statistic.
1 2 3 4 5 6 7 8 9 10 11 | BLB_R(data, gamma, FUN, ..., s = 15, r = 100)
BLB_serial(data, gamma, s = 15, r = 100)
BLB_omp_on_s(data, gamma, s = 15, r = 100)
BLB_omp_on_r(data, gamma, s = 15, r = 100)
BLB_omp_on_sr(data, gamma, s = 15, r = 100)
BLB_cluster(data, gamma, cluster, s = 15, r = 100)
|
data |
A vector of the original sample |
gamma |
Controls the size of the subsamples - each subsample is of size b = (floor(length(data) ^ gamma). Ideally in gamma is in [0.5, 1] |
FUN |
A function to calculate the estimator of the parameter of interest |
s |
The number of subsamples |
r |
The number of bootstrap replications (resamples) per subsample |
The functions described here implement the Bag of Little Bootstraps (BLB) with varying degrees of efficiency.
BLB_R
implements BLB entirely in R. It is the most generic function, in that it can accept any function (which acts on a vector) as the statistic to be bootstrapped. It is also by far the slowest implementations.
The rest of the functions are all implemented in C, but are built in to only be able to bootstrap the mean.
BLB_serial
does not take advantage of any parallelism.
BLB_omp_on_s
uses openMP to parallelise the for loop over the s subsampling steps, then runs a serial bootstrap function within each subsample.
BLB_omp_on_r
does not parallelise over the s subsamples, but uses openMP to parallelise the for loop over the r resampling steps within each subsample.
BLB_omp_on_rs
uses openMP to parallelise over both the subsampling and resampling loops.
BLB_cluster
uses parallelism in R to send each of the s subsamples to different servers in the cluster, then uses openMP to parallelise the interations over the r resamples within each subsample.
The mean across the s subsamples of the standard errors of the parameter estimates
1 2 3 4 5 6 7 8 | X <- rnorm(1000000, 0, 5)
BLB_R(X, mean, gamma=0.6)
BLB_serial(X, 0.9)
BLB_omp_on_s(X, 0.6)
BLB_omp_on_r(X, 0.6)
BLB_omp_on_sr(X, 0.6)
cluster <- c("greywagtail", "greyheron", "greypartridge", "greyplover")
BLB_cluster(X, 0.6, cluster, s=16, r=96)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.