Description Usage Arguments Details Value Functions Examples
When bootstrapping, we are traditionally instructed to generate a sample equal in size to the entire dataset. We can shortcut this method, as long as we are willing to make certain adjustments when calculating confidence intervals. Two alternative sampling methods are tested here, one with replacement and the other without.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | bootstrap_experiment(funs, nrange = c(1000, 10000), rrange = c(0.25, 0.75),
mus = c(0, 4.5), sigmas = c(1, 5.5), bsi_range = c(1000, 10000),
length.out = 5, niter = 5)
compare_methods(param, funs)
bs_sim(x, bsi, replace, funs, n, b, ..., probs = c(0.025, 0.975))
red_se(x, probs = c(0.025, 0.975), n, b, xbar)
ss_quantiles(x, probs = c(0.025, 0.975), n, b, xbar)
quantile_ev(x, probs = c(0.025, 0.975), n, b, xbar, int = c(-500, 500))
se_ci(x, probs = c(0.025, 0.975), ...)
qntl(x, probs = c(0.025, 0.975), ...)
|
funs |
a list of functions for calculating confidence intervals |
nrange |
the length of the vector |
rrange |
the portion of the vector's length used in each subsample |
mus |
the mean of the sampling distribution |
sigmas |
the variance of the sampling distribution |
bsi_range |
the number of bootstrap iterations |
length.out |
the number of parameters drawn from the range |
niter |
the number of repetitions for each parameter combination |
The primary functions simulate data for estimating bootstrapped CIs for the mean of a
normally-distributed vector. They accept ranges for the simulation parameters. These
are described in the parameters. The experiment is generic in that you can pass it
multiple different functions for calculating confidence intervals in a list. When
these functions have different parameters, it is usually necessary to have ...
in all of their arguments.
The simulation is split across one function to generate parameters and iterators, and a second function that executes a single iteration. That function also relies on a generic bootstrap simulator.
The function experiment
generates the test, which results in a data frame
that contains:
the confidence interval method
whether replacement was used in sampling
the upper and lower limits of the confidence interval
the combination of sampling parmaters
the bias of the upper and lower CI limits
the sum of the square biases
compare_methods
: One iteration of bootstrap experiment
bs_sim
: A generic bootstrap estimator
red_se
: Adjusting standard errors for smaller samples
ss_quantiles
: Subsamping quantiles (using differences)
quantile_ev
: Subsamping quantiles (with empirical distribution function)
se_ci
: Another confidence interval function
qntl
: A curried version of quantile to catch unnecessary arguments
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.