# Bootstrapping (statistics)

__: Statistical method__

**Short description**

**Bootstrapping** is any test or metric that uses random sampling with replacement (e.g. mimicking the sampling process), and falls under the broader class of resampling methods. Bootstrapping assigns measures of accuracy (bias, variance, confidence intervals, prediction error, etc.) to sample estimates.^{[1]}^{[2]} This technique allows estimation of the sampling distribution of almost any statistic using random sampling methods.^{[3]}^{[4]}

Bootstrapping estimates the properties of an estimator (such as its variance) by measuring those properties when sampling from an approximating distribution. One standard choice for an approximating distribution is the empirical distribution function of the observed data. In the case where a set of observations can be assumed to be from an independent and identically distributed population, this can be implemented by constructing a number of resamples with replacement, of the observed data set (and of equal size to the observed data set).

It may also be used for constructing hypothesis tests. It is often used as an alternative to statistical inference based on the assumption of a parametric model when that assumption is in doubt, or where parametric inference is impossible or requires complicated formulas for the calculation of standard errors.

## History

The bootstrap was published by Bradley Efron in "Bootstrap methods: another look at the jackknife" (1979),^{[5]}^{[6]}^{[7]} inspired by earlier work on the jackknife.^{[8]}^{[9]}^{[10]} Improved estimates of the variance were developed later.^{[11]}^{[12]} A Bayesian extension was developed in 1981.^{[13]} The bias-corrected and accelerated (BCa) bootstrap was developed by Efron in 1987,^{[14]} and the ABC procedure in 1992.^{[15]}

## Approach

The basic idea of bootstrapping is that inference about a population from sample data (sample → population) can be modeled by *resampling* the sample data and performing inference about a sample from resampled data (resampled → sample). As the population is unknown, the true error in a sample statistic against its population value is unknown. In bootstrap-resamples, the 'population' is in fact the sample, and this is known; hence the quality of inference of the 'true' sample from resampled data (resampled → sample) is measurable.

More formally, the bootstrap works by treating inference of the true probability distribution *J*, given the original data, as being analogous to an inference of the empirical distribution *Ĵ*, given the resampled data. The accuracy of inferences regarding *Ĵ* using the resampled data can be assessed because we know *Ĵ*. If *Ĵ* is a reasonable approximation to *J*, then the quality of inference on *J* can in turn be inferred.

As an example, assume we are interested in the average (or mean) height of people worldwide. We cannot measure all the people in the global population, so instead, we sample only a tiny part of it, and measure that. Assume the sample is of size *N*; that is, we measure the heights of *N* individuals. From that single sample, only one estimate of the mean can be obtained. In order to reason about the population, we need some sense of the variability of the mean that we have computed. The simplest bootstrap method involves taking the original data set of heights, and, using a computer, sampling from it to form a new sample (called a 'resample' or bootstrap sample) that is also of size *N*. The bootstrap sample is taken from the original by using sampling with replacement (e.g. we might 'resample' 5 times from [1,2,3,4,5] and get [2,5,4,4,1]), so, assuming *N* is sufficiently large, for all practical purposes there is virtually zero probability that it will be identical to the original "real" sample. This process is repeated a large number of times (typically 1,000 or 10,000 times), and for each of these bootstrap samples, we compute its mean (each of these is called bootstrap estimates). We now can create a histogram of bootstrap means. This histogram provides an estimate of the shape of the distribution of the sample mean from which we can answer questions about how much the mean varies across samples. (The method here, described for the mean, can be applied to almost any other statistic or estimator.)

## Discussion

### Advantages

A great advantage of bootstrap is its simplicity. It is a straightforward way to derive estimates of standard errors and confidence intervals for complex estimators of the distribution, such as percentile points, proportions, odds ratio, and correlation coefficients. However, despite its simplicity, bootstrapping can be applied to complex sampling designs (e.g. for population divided into s strata with n_{s} observations per strata, bootstrapping can be applied for each strata).^{[16]} Bootstrap is also an appropriate way to control and check the stability of the results. Although for most problems it is impossible to know the true confidence interval, bootstrap is asymptotically more accurate than the standard intervals obtained using sample variance and assumptions of normality.^{[17]} Bootstrapping is also a convenient method that avoids the cost of repeating the experiment to get other groups of sample data.

### Disadvantages

Bootstrapping depends heavily on the estimator used and, though simple, ignorant use of bootstrapping will not always yield asymptotically valid results and can lead to inconsistency.^{[18]} Although bootstrapping is (under some conditions) asymptotically consistent, it does not provide general finite-sample guarantees. The result may depend on the representative sample. The apparent simplicity may conceal the fact that important assumptions are being made when undertaking the bootstrap analysis (e.g. independence of samples or large enough of a sample size) where these would be more formally stated in other approaches. Also, bootstrapping can be time-consuming and there are not many available software for bootstrapping as it is difficult to automate using traditional statistical computer packages.^{[16]}

### Recommendations

Scholars have recommended more bootstrap samples as available computing power has increased. If the results may have substantial real-world consequences, then one should use as many samples as is reasonable, given available computing power and time. Increasing the number of samples cannot increase the amount of information in the original data; it can only reduce the effects of random sampling errors which can arise from a bootstrap procedure itself. Moreover, there is evidence that numbers of samples greater than 100 lead to negligible improvements in the estimation of standard errors.^{[19]} In fact, according to the original developer of the bootstrapping method, even setting the number of samples at 50 is likely to lead to fairly good standard error estimates.^{[20]}

Adèr et al. recommend the bootstrap procedure for the following situations:^{[21]}

- When the theoretical distribution of a statistic of interest is complicated or unknown. Since the bootstrapping procedure is distribution-independent it provides an indirect method to assess the properties of the distribution underlying the sample and the parameters of interest that are derived from this distribution.

- When the sample size is insufficient for straightforward statistical inference. If the underlying distribution is well-known, bootstrapping provides a way to account for the distortions caused by the specific sample that may not be fully representative of the population.

- When power calculations have to be performed, and a small pilot sample is available. Most power and sample size calculations are heavily dependent on the standard deviation of the statistic of interest. If the estimate used is incorrect, the required sample size will also be wrong. One method to get an impression of the variation of the statistic is to use a small pilot sample and perform bootstrapping on it to get impression of the variance.

However, Athreya has shown^{[22]} that if one performs a naive bootstrap on the sample mean when the underlying population lacks a finite variance (for example, a power law distribution), then the bootstrap distribution will not converge to the same limit as the sample mean. As a result, confidence intervals on the basis of a Monte Carlo simulation of the bootstrap could be misleading. Athreya states that "Unless one is reasonably sure that the underlying distribution is not heavy tailed, one should hesitate to use the naive bootstrap".

## Types of bootstrap scheme

In univariate problems, it is usually acceptable to resample the individual observations with replacement ("case resampling" below) unlike subsampling, in which resampling is without replacement and is valid under much weaker conditions compared to the bootstrap. In small samples, a parametric bootstrap approach might be preferred. For other problems, a *smooth bootstrap* will likely be preferred.

For regression problems, various other alternatives are available.^{[23]}

### Case resampling

Bootstrap is generally useful for estimating the distribution of a statistic (e.g. mean, variance) without using normal theory (e.g. z-statistic, t-statistic). Bootstrap comes in handy when there is no analytical form or normal theory to help estimate the distribution of the statistics of interest since bootstrap methods can apply to most random quantities, e.g., the ratio of variance and mean. There are at least two ways of performing case resampling.

- The Monte Carlo algorithm for case resampling is quite simple. First, we resample the data with replacement, and the size of the resample must be equal to the size of the original data set. Then the statistic of interest is computed from the resample from the first step. We repeat this routine many times to get a more precise estimate of the Bootstrap distribution of the statistic.
- The 'exact' version for case resampling is similar, but we exhaustively enumerate every possible resample of the data set. This can be computationally expensive as there are a total of [math]\displaystyle{ \binom {2n-1}n = \frac{(2n-1)!}{n! (n-1)!} }[/math] different resamples, where
*n*is the size of the data set. Thus for*n*= 5, 10, 20, 30 there are 126, 92378, 6.89 × 10^{10}and 5.91 × 10^{16}different resamples respectively.^{[24]}

#### Estimating the distribution of sample mean

Consider a coin-flipping experiment. We flip the coin and record whether it lands heads or tails. Let *X = x*_{1}, *x*_{2}, …, *x*_{10} be 10 observations from the experiment. *x _{i}* = 1 if the i th flip lands heads, and 0 otherwise. From normal theory, we can use the t-statistic to estimate the distribution of the sample mean,

- [math]\displaystyle{ \bar{x} = \frac{1}{10} (x_1 + x_2 + \cdots + x_{10}). }[/math]

Instead, we use the bootstrap, specifically case resampling, to derive the distribution of [math]\displaystyle{ \bar{x} }[/math]. We first resample the data to obtain a *bootstrap resample*. An example of the first resample might look like this *X*_{1}* = *x*_{2}, *x*_{1}, *x*_{10}, *x*_{10}, *x*_{3}, *x*_{4}, *x*_{6}, *x*_{7}, *x*_{1}, *x*_{9}. There are some duplicates since a bootstrap resample comes from sampling with replacement from the data. Also the number of data points in a bootstrap resample is equal to the number of data points in our original observations. Then we compute the mean of this resample and obtain the first *bootstrap mean*: *μ*_{1}*. We repeat this process to obtain the second resample *X*_{2}* and compute the second bootstrap mean *μ*_{2}*. If we repeat this 100 times, then we have *μ*_{1}*, *μ*_{2}*, ..., *μ*_{100}*. This represents an *empirical bootstrap distribution* of sample mean. From this empirical distribution, one can derive a *bootstrap confidence interval* for the purpose of hypothesis testing.

#### Regression

In regression problems, *case resampling* refers to the simple scheme of resampling individual cases – often rows of a data set. For regression problems, as long as the data set is fairly large, this simple scheme is often acceptable.^{[25]}^{[26]}^{[27]} However, the method is open to criticism.^{[16]}

In regression problems, the explanatory variables are often fixed, or at least observed with more control than the response variable. Also, the range of the explanatory variables defines the information available from them. Therefore, to resample cases means that each bootstrap sample will lose some information. As such, alternative bootstrap procedures should be considered.

### Bayesian bootstrap

Bootstrapping can be interpreted in a Bayesian framework using a scheme that creates new data sets through reweighting the initial data. Given a set of [math]\displaystyle{ N }[/math] data points, the weighting assigned to data point [math]\displaystyle{ i }[/math] in a new data set [math]\displaystyle{ \mathcal{D}^J }[/math] is [math]\displaystyle{ w^J_i = x^J_i - x^J_{i-1} }[/math], where [math]\displaystyle{ \mathbf{x}^J }[/math] is a low-to-high ordered list of [math]\displaystyle{ N-1 }[/math] uniformly distributed random numbers on [math]\displaystyle{ [0,1] }[/math], preceded by 0 and succeeded by 1. The distributions of a parameter inferred from considering many such data sets [math]\displaystyle{ \mathcal{D}^J }[/math] are then interpretable as posterior distributions on that parameter.^{[28]}

### Smooth bootstrap

Under this scheme, a small amount of (usually normally distributed) zero-centered random noise is added onto each resampled observation. This is equivalent to sampling from a kernel density estimate of the data. Assume *K* to be a symmetric kernel density function with unit variance. The standard kernel estimator [math]\displaystyle{ \hat{f\,}_h(x) }[/math] of [math]\displaystyle{ f(x) }[/math] is

- [math]\displaystyle{ \hat{f\,}_h(x)={1\over nh}\sum_{i=1}^nK\left({x-X_i\over h}\right), }[/math]
^{[29]}

where [math]\displaystyle{ h }[/math] is the smoothing parameter. And the corresponding distribution function estimator [math]\displaystyle{ \hat{F\,}_h(x) }[/math] is

- [math]\displaystyle{ \hat{F\,}_h(x)=\int_{-\infty}^x \hat f_h(t)\,dt. }[/math]
^{[29]}

### Parametric bootstrap

Based on the assumption that the original data set is a realization of a random sample from a distribution of a specific parametric type, in this case a parametric model is fitted by parameter θ, often by maximum likelihood, and samples of random numbers are drawn from this fitted model. Usually the sample drawn has the same sample size as the original data. Then the estimate of original function F can be written as [math]\displaystyle{ \hat{F}=F_{\hat{\theta}} }[/math]. This sampling process is repeated many times as for other bootstrap methods. Considering the centered sample mean in this case, the random sample original distribution function [math]\displaystyle{ F_{\theta} }[/math] is replaced by a bootstrap random sample with function [math]\displaystyle{ F_{\hat{\theta}} }[/math], and the probability distribution of [math]\displaystyle{ \bar{X_{n}}-\mu_{\theta} }[/math] is approximated by that of [math]\displaystyle{ \bar{X}_n^*-\mu^* }[/math], where [math]\displaystyle{ \mu^*=\mu_{\hat{\theta}} }[/math], which is the expectation corresponding to [math]\displaystyle{ F_{\hat{\theta}} }[/math].^{[30]} The use of a parametric model at the sampling stage of the bootstrap methodology leads to procedures which are different from those obtained by applying basic statistical theory to inference for the same model.

### Resampling residuals

Another approach to bootstrapping in regression problems is to resample residuals. The method proceeds as follows.

- Fit the model and retain the fitted values [math]\displaystyle{ \widehat{y\,}_i }[/math] and the residuals [math]\displaystyle{ \widehat{\varepsilon\,}_i = y_i - \widehat{y\,}_i, (i = 1,\dots, n) }[/math].
- For each pair, (
*x*,_{i}*y*), in which_{i}*x*is the (possibly multivariate) explanatory variable, add a randomly resampled residual, [math]\displaystyle{ \widehat{\varepsilon\,}_j }[/math], to the fitted value [math]\displaystyle{ \widehat{y\,}_i }[/math]. In other words, create synthetic response variables [math]\displaystyle{ y^*_i = \widehat{y\,}_i + \widehat{\varepsilon\,}_j }[/math] where_{i}*j*is selected randomly from the list (1, ...,*n*) for every*i*. - Refit the model using the fictitious response variables [math]\displaystyle{ y^*_i }[/math], and retain the quantities of interest (often the parameters, [math]\displaystyle{ \widehat\mu^*_i }[/math], estimated from the synthetic [math]\displaystyle{ y^*_i }[/math]).
- Repeat steps 2 and 3 a large number of times.

This scheme has the advantage that it retains the information in the explanatory variables. However, a question arises as to which residuals to resample. Raw residuals are one option; another is studentized residuals (in linear regression). Although there are arguments in favor of using studentized residuals; in practice, it often makes little difference, and it is easy to compare the results of both schemes.

### Gaussian process regression bootstrap

When data are temporally correlated, straightforward bootstrapping destroys the inherent correlations. This method uses Gaussian process regression (GPR) to fit a probabilistic model from which replicates may then be drawn. GPR is a Bayesian non-linear regression method. A Gaussian process (GP) is a collection of random variables, any finite number of which have a joint Gaussian (normal) distribution. A GP is defined by a mean function and a covariance function, which specify the mean vectors and covariance matrices for each finite collection of the random variables.^{[31]}

**Regression model:**

- [math]\displaystyle{ y(x)=f(x)+\varepsilon,\ \ \varepsilon\sim \mathcal{N}(0,\sigma^2), }[/math] [math]\displaystyle{ \varepsilon }[/math] is a noise term.

**Gaussian process prior:**

For any finite collection of variables, *x*_{1}, ..., *x*_{n}, the function outputs [math]\displaystyle{ f(x_1),\ldots,f(x_n) }[/math] are jointly distributed according to a multivariate Gaussian with mean [math]\displaystyle{ m=[m(x_1),\ldots,m(x_n)]^\intercal
}[/math] and covariance matrix [math]\displaystyle{ (K)_{ij}=k(x_i,x_j). }[/math]

Assume [math]\displaystyle{ f(x)\sim \mathcal{GP}(m,k). }[/math] Then [math]\displaystyle{ y(x)\sim \mathcal{GP}(m,l) }[/math],

where [math]\displaystyle{ l(x_i,x_j)=k(x_i,x_j)+\sigma^2\delta(x_i,x_j) }[/math], and [math]\displaystyle{ \delta(x_i,x_j) }[/math] is the standard Kronecker delta function.^{[31]}

**Gaussian process posterior:**

According to GP prior, we can get

- [math]\displaystyle{ [y(x_1),\ldots,y(x_r)]\sim \mathcal{N}(m_0,K_0) }[/math],

where [math]\displaystyle{ m_0=[m(x_1),\ldots,m(x_r)]^\intercal }[/math] and [math]\displaystyle{ (K_0)_{ij}=k(x_i,x_j)+\sigma^2\delta(x_i,x_j). }[/math]

Let x_{1}^{*},...,x_{s}^{*} be another finite collection of variables, it's obvious that

- [math]\displaystyle{ [y(x_1),\ldots,y(x_r),f(x_1^*),\ldots,f(x_s^*)]^\intercal\sim \mathcal{N}(\binom{m_0}{m_*}\begin{pmatrix} K_0 & K_* \\ K_*^\intercal & K_{**} \end{pmatrix}) }[/math],

where [math]\displaystyle{ m_*=[m(x_1^*),\ldots,m(x_s^*)]^\intercal }[/math], [math]\displaystyle{ (K_{**})_{ij}=k(x_i^*,x_j^*) }[/math], [math]\displaystyle{ (K_*)_{ij}=k(x_i,x_j^*). }[/math]

According to the equations above, the outputs *y* are also jointly distributed according to a multivariate Gaussian. Thus,

- [math]\displaystyle{ [f(x_1^*),\ldots,f(x_s^*)]^\intercal\mid([y(x)]^\intercal=y)\sim \mathcal{N}(m_\text{post},K_\text{post}), }[/math]

where [math]\displaystyle{ y=[y_1,...,y_r]^\intercal }[/math], [math]\displaystyle{ m_\text{post}=m_*+K_*^\intercal(K_O+\sigma^2I_r)^{-1}(y-m_0) }[/math], [math]\displaystyle{ K_\text{post}=K_{**}-K_*^\intercal(K_O+\sigma^2I_r)^{-1}K_* }[/math], and [math]\displaystyle{ I_r }[/math] is [math]\displaystyle{ r\times r }[/math] identity matrix.^{[31]}

### Wild bootstrap

The wild bootstrap, proposed originally by Wu (1986),^{[32]} is suited when the model exhibits heteroskedasticity. The idea is, as the residual bootstrap, to leave the regressors at their sample value, but to resample the response variable based on the residuals values. That is, for each replicate, one computes a new [math]\displaystyle{ y }[/math] based on

- [math]\displaystyle{ y^*_i = \widehat{y\,}_i + \widehat{\varepsilon\,}_i v_i }[/math]

so the residuals are randomly multiplied by a random variable [math]\displaystyle{ v_i }[/math] with mean 0 and variance 1. For most distributions of [math]\displaystyle{ v_i }[/math] (but not Mammen's), this method assumes that the 'true' residual distribution is symmetric and can offer advantages over simple residual sampling for smaller sample sizes. Different forms are used for the random variable [math]\displaystyle{ v_i }[/math], such as

- The standard normal distribution

- A distribution suggested by Mammen (1993).
^{[33]}

- A distribution suggested by Mammen (1993).

- [math]\displaystyle{ v_i = \begin{cases} -(\sqrt{5} -1)/2 & \text{with probability } (\sqrt{5} +1)/(2\sqrt{5}), \\ (\sqrt{5} +1)/2 & \text{with probability } (\sqrt{5} -1)/(2\sqrt{5}) \end{cases} }[/math]

- Approximately, Mammen's distribution is:

- [math]\displaystyle{ v_i = \begin{cases} -0.6180\quad\text{(with a 0 in the units' place)} & \text{with probability } 0.7236, \\ +1.6180\quad\text{(with a 1 in the units' place)} & \text{with probability } 0.2764. \end{cases} }[/math]

- Or the simpler distribution, linked to the Rademacher distribution:

- [math]\displaystyle{ v_i =\begin{cases} -1 & \text{with probability } 1/2, \\ +1 & \text{with probability } 1/2. \end{cases} }[/math]

### Block bootstrap

The block bootstrap is used when the data, or the errors in a model, are correlated. In this case, a simple case or residual resampling will fail, as it is not able to replicate the correlation in the data. The block bootstrap tries to replicate the correlation by resampling inside blocks of data (see Blocking (statistics)). The block bootstrap has been used mainly with data correlated in time (i.e. time series) but can also be used with data correlated in space, or among groups (so-called cluster data).

#### Time series: Simple block bootstrap

In the (simple) block bootstrap, the variable of interest is split into non-overlapping blocks.

#### Time series: Moving block bootstrap

In the moving block bootstrap, introduced by Künsch (1989),^{[34]} data is split into *n* − *b* + 1 overlapping blocks of length *b*: Observation 1 to b will be block 1, observation 2 to *b* + 1 will be block 2, etc. Then from these *n* − *b* + 1 blocks, *n*/*b* blocks will be drawn at random with replacement. Then aligning these n/b blocks in the order they were picked, will give the bootstrap observations.

This bootstrap works with dependent data, however, the bootstrapped observations will not be stationary anymore by construction. But, it was shown that varying randomly the block length can avoid this problem.^{[35]} This method is known as the *stationary bootstrap.* Other related modifications of the moving block bootstrap are the *Markovian bootstrap* and a stationary bootstrap method that matches subsequent blocks based on standard deviation matching.

#### Time series: Maximum entropy bootstrap

Vinod (2006),^{[36]} presents a method that bootstraps time series data using maximum entropy principles satisfying the Ergodic theorem with mean-preserving and mass-preserving constraints. There is an R package, **meboot**,^{[37]} that utilizes the method, which has applications in econometrics and computer science.

#### Cluster data: block bootstrap

Cluster data describes data where many observations per unit are observed. This could be observing many firms in many states or observing students in many classes. In such cases, the correlation structure is simplified, and one does usually make the assumption that data is correlated within a group/cluster, but independent between groups/clusters. The structure of the block bootstrap is easily obtained (where the block just corresponds to the group), and usually only the groups are resampled, while the observations within the groups are left unchanged. Cameron et al. (2008) discusses this for clustered errors in linear regression.^{[38]}

## Methods for improving computational efficiency

The bootstrap is a powerful technique although may require substantial computing resources in both time and memory. Some techniques have been developed to reduce this burden. They can generally be combined with many of the different types of Bootstrap schemes and various choices of statistics.

### Poisson bootstrap

The ordinary bootstrap requires the random selection of n elements from a list, which is equivalent to drawing from a multinomial distribution. This may require a large number of passes over the data and is challenging to run these computations in parallel. For large values of n, the Poisson bootstrap is an efficient method of generating bootstrapped data sets.^{[39]} When generating a single bootstrap sample, instead of randomly drawing from the sample data with replacement, each data point is assigned a random weight distributed according to the Poisson distribution with [math]\displaystyle{ \lambda=1 }[/math]. For large sample data, this will approximate random sampling with replacement. This is due to the following approximation:

- [math]\displaystyle{ \lim_{n\to \infty} \operatorname{Binomial}(n,1/n) = \operatorname{Poisson}(1) }[/math]

This method also lends itself well to streaming data and growing data sets, since the total number of samples does not need to be known in advance of beginning to take bootstrap samples.

For large enough n, the results are relatively similar to the original bootstrap estimations.^{[40]}

A way to improve on the poisson bootstrap, termed "sequential bootstrap", is by taking the first samples so that the proportion of unique values is ~0.632 of the original sample size n. This provides a distribution with main empirical characteristics being within a distance of [math]\displaystyle{ O(n^{3/4}) }[/math].^{[41]} Empirical investigation has shown this method can yield good results.^{[42]} This is related to the reduced bootstrap method.^{[43]}

### Bag of Little Bootstraps

For massive data sets, it is often computationally prohibitive to hold all the sample data in memory and resample from the sample data. The Bag of Little Bootstraps (BLB)^{[44]} provides a method of pre-aggregating data before bootstrapping to reduce computational constraints. This works by partitioning the data set into [math]\displaystyle{ b }[/math] equal-sized buckets and aggregating the data within each bucket. This pre-aggregated data set becomes the new sample data over which to draw samples with replacement. This method is similar to the Block Bootstrap, but the motivations and definitions of the blocks are very different. Under certain assumptions, the sample distribution should approximate the full bootstrapped scenario. One constraint is the number of buckets [math]\displaystyle{ b=n^\gamma }[/math]where [math]\displaystyle{ \gamma \in [0.5, 1] }[/math] and the authors recommend usage of [math]\displaystyle{ b=n^{0.7} }[/math] as a general solution.

## Choice of statistic

The bootstrap distribution of a point estimator of a population parameter has been used to produce a bootstrapped confidence interval for the parameter's true value if the parameter can be written as a function of the population's distribution.

Population parameters are estimated with many point estimators. Popular families of point-estimators include mean-unbiased minimum-variance estimators, median-unbiased estimators, Bayesian estimators (for example, the posterior distribution's mode, median, mean), and maximum-likelihood estimators.

A Bayesian point estimator and a maximum-likelihood estimator have good performance when the sample size is infinite, according to asymptotic theory. For practical problems with finite samples, other estimators may be preferable. Asymptotic theory suggests techniques that often improve the performance of bootstrapped estimators; the bootstrapping of a maximum-likelihood estimator may often be improved using transformations related to pivotal quantities.^{[45]}

## Deriving confidence intervals from the bootstrap distribution

The bootstrap distribution of a parameter-estimator has been used to calculate confidence intervals for its population-parameter.^{[1]}

### Bias, asymmetry, and confidence intervals

**Bias**: The bootstrap distribution and the sample may disagree systematically, in which case bias may occur.- If the bootstrap distribution of an estimator is symmetric, then percentile confidence-interval are often used; such intervals are appropriate especially for median-unbiased estimators of minimum risk (with respect to an absolute loss function). Bias in the bootstrap distribution will lead to bias in the confidence interval.
- Otherwise, if the bootstrap distribution is non-symmetric, then percentile confidence intervals are often inappropriate.

### Methods for bootstrap confidence intervals

There are several methods for constructing confidence intervals from the bootstrap distribution of a real parameter:

**Basic bootstrap**,^{[45]}also known as the**Reverse Percentile Interval**.^{[46]}The basic bootstrap is a simple scheme to construct the confidence interval: one simply takes the empirical quantiles from the bootstrap distribution of the parameter (see Davison and Hinkley 1997, equ. 5.6 p. 194):

- [math]\displaystyle{ (2\widehat{\theta\,} -\theta^{*}_{(1-\alpha/2)},2\widehat{\theta\,} -\theta^{*}_{(\alpha/2)}) }[/math] where [math]\displaystyle{ \theta^{*}_{(1-\alpha/2)} }[/math] denotes the [math]\displaystyle{ 1-\alpha/2 }[/math] percentile of the bootstrapped coefficients [math]\displaystyle{ \theta^{*} }[/math].

**Percentile bootstrap**. The percentile bootstrap proceeds in a similar way to the basic bootstrap, using percentiles of the bootstrap distribution, but with a different formula (note the inversion of the left and right quantiles):

- [math]\displaystyle{ (\theta^{*}_{(\alpha/2)},\theta^{*}_{(1-\alpha/2)}) }[/math] where [math]\displaystyle{ \theta^{*}_{(1-\alpha/2)} }[/math] denotes the [math]\displaystyle{ 1-\alpha/2 }[/math] percentile of the bootstrapped coefficients [math]\displaystyle{ \theta^{*} }[/math].

- See Davison and Hinkley (1997, equ. 5.18 p. 203) and Efron and Tibshirani (1993, equ 13.5 p. 171).
- This method can be applied to any statistic. It will work well in cases where the bootstrap distribution is symmetrical and centered on the observed statistic
^{[47]}and where the sample statistic is median-unbiased and has maximum concentration (or minimum risk with respect to an absolute value loss function). When working with small sample sizes (i.e., less than 50), the basic / reversed percentile and percentile confidence intervals for (for example) the variance statistic will be too narrow. So that with a sample of 20 points, 90% confidence interval will include the true variance only 78% of the time.^{[48]}The basic / reverse percentile confidence intervals are easier to justify mathematically^{[49]}^{[46]}but they are less accurate in general than percentile confidence intervals, and some authors discourage their use.^{[46]}

**Studentized bootstrap**. The studentized bootstrap, also called*bootstrap-t*, is computed analogously to the standard confidence interval, but replaces the quantiles from the normal or student approximation by the quantiles from the bootstrap distribution of the Student's t-test (see Davison and Hinkley 1997, equ. 5.7 p. 194 and Efron and Tibshirani 1993 equ 12.22, p. 160):

- [math]\displaystyle{ (\widehat{\theta\,} - t^{*}_{(1-\alpha/2)}\cdot \widehat{\text{se}}_\theta,\widehat{\theta\,} - t^{*}_{(\alpha/2)}\cdot \widehat{\text{se}}_\theta) }[/math] where [math]\displaystyle{ t^{*}_{(1-\alpha/2)} }[/math] denotes the [math]\displaystyle{ 1-\alpha/2 }[/math] percentile of the bootstrapped Student's t-test [math]\displaystyle{ t^{*}=(\widehat{\theta\,}^{*}-\widehat{\theta\,})/\widehat{\text{se}}_{\widehat{\theta\,}^*} }[/math], and [math]\displaystyle{ \widehat{\text{se}}_\theta }[/math] is the estimated standard error of the coefficient in the original model.

- The studentized test enjoys optimal properties as the statistic that is bootstrapped is pivotal (i.e. it does not depend on nuisance parameters as the t-test follows asymptotically a N(0,1) distribution), unlike the percentile bootstrap.

**Bias-corrected bootstrap**– adjusts for bias in the bootstrap distribution.**Accelerated bootstrap**– The bias-corrected and accelerated (BCa) bootstrap, by Efron (1987),^{[14]}adjusts for both bias and skewness in the bootstrap distribution. This approach is accurate in a wide variety of settings, has reasonable computation requirements, and produces reasonably narrow intervals.^{[14]}

### Bootstrap hypothesis testing

Efron and Tibshirani^{[1]} suggest the following algorithm for comparing the means of two independent samples:
Let [math]\displaystyle{ x_1, \ldots, x_n }[/math] be a random sample from distribution F with sample mean [math]\displaystyle{ \bar{x} }[/math] and sample variance [math]\displaystyle{ \sigma_x^2 }[/math]. Let [math]\displaystyle{ y_1, \ldots, y_m }[/math] be another, independent random sample from distribution G with mean [math]\displaystyle{ \bar{y} }[/math] and variance [math]\displaystyle{ \sigma_y^2 }[/math]

- Calculate the test statistic [math]\displaystyle{ t = \frac{\bar{x}-\bar{y}}{\sqrt{\sigma_x^2/n + \sigma_y^2/m}} }[/math]
- Create two new data sets whose values are [math]\displaystyle{ x_i' = x_i - \bar{x} + \bar{z} }[/math] and [math]\displaystyle{ y_i' = y_i - \bar{y} + \bar{z}, }[/math] where [math]\displaystyle{ \bar{z} }[/math] is the mean of the combined sample.
- Draw a random sample ([math]\displaystyle{ x_i^* }[/math]) of size [math]\displaystyle{ n }[/math] with replacement from [math]\displaystyle{ x_i' }[/math] and another random sample ([math]\displaystyle{ y_i^* }[/math]) of size [math]\displaystyle{ m }[/math] with replacement from [math]\displaystyle{ y_i' }[/math].
- Calculate the test statistic [math]\displaystyle{ t^* = \frac{\bar{x^*}-\bar{y^*}}{\sqrt{\sigma_x^{*2}/n + \sigma_y^{*2}/m}} }[/math]
- Repeat 3 and 4 [math]\displaystyle{ B }[/math] times (e.g. [math]\displaystyle{ B=1000 }[/math]) to collect [math]\displaystyle{ B }[/math] values of the test statistic.
- Estimate the p-value as [math]\displaystyle{ p = \frac{\sum_{i=1}^B I\{t_i^* \geq t\}}{B} }[/math] where [math]\displaystyle{ I(\text{condition}) = 1 }[/math] when
*condition*is true and 0 otherwise.

## Example applications

### Smoothed bootstrap

In 1878, Simon Newcomb took observations on the speed of light.^{[50]}
The data set contains two outliers, which greatly influence the sample mean. (The sample mean need not be a consistent estimator for any population mean, because no mean needs to exist for a heavy-tailed distribution.) A well-defined and robust statistic for the central tendency is the sample median, which is consistent and median-unbiased for the population median.

The bootstrap distribution for Newcomb's data appears below. We can reduce the discreteness of the bootstrap distribution by adding a small amount of random noise to each bootstrap sample. A conventional choice is to add noise with a standard deviation of [math]\displaystyle{ \sigma/\sqrt n }[/math] for a sample size *n*; this noise is often drawn from a Student-t distribution with *n-1* degrees of freedom.^{[51]} This results in an approximately-unbiased estimator for the variance of the sample mean. This means that samples taken from the bootstrap distribution will have a variance which is, on average, equal to the variance of the total population.

Histograms of the bootstrap distribution and the smooth bootstrap distribution appear below. The bootstrap distribution of the sample-median has only a small number of values. The smoothed bootstrap distribution has a richer support. However, note that whether the smoothed or standard bootstrap procedure is favorable is case-by-case and is shown to depend on both the underlying distribution function and on the quantity being estimated.^{[52]}

In this example, the bootstrapped 95% (percentile) confidence-interval for the population median is (26, 28.5), which is close to the interval for (25.98, 28.46) for the smoothed bootstrap.

## Relation to other approaches to inference

### Relationship to other resampling methods

The bootstrap is distinguished from:

- the jackknife procedure, used to estimate biases of sample statistics and to estimate variances, and
- cross-validation, in which the parameters (e.g., regression weights, factor loadings) that are estimated in one subsample are applied to another subsample.

For more details see bootstrap resampling.

Bootstrap aggregating (bagging) is a meta-algorithm based on averaging the results of multiple bootstrap samples.

### U-statistics

In situations where an obvious statistic can be devised to measure a required characteristic using only a small number, *r*, of data items, a corresponding statistic based on the entire sample can be formulated. Given an *r*-sample statistic, one can create an *n*-sample statistic by something similar to bootstrapping (taking the average of the statistic over all subsamples of size *r*). This procedure is known to have certain good properties and the result is a U-statistic. The sample mean and sample variance are of this form, for *r* = 1 and *r* = 2.

## See also

- Accuracy and precision
- Bootstrap aggregating
- Bootstrapping
- Empirical likelihood
- Imputation (statistics)
- Reliability (statistics)
- Reproducibility
- Resampling

## References

- ↑
^{1.0}^{1.1}^{1.2}Efron, B.; Tibshirani, R. (1993).*An Introduction to the Bootstrap*. Boca Raton, FL: Chapman & Hall/CRC. ISBN 0-412-04231-2. software - ↑ Second Thoughts on the Bootstrap – Bradley Efron, 2003
- ↑ Varian, H.(2005). "Bootstrap Tutorial".
*Mathematica Journal*, 9, 768–775. - ↑ Weisstein, Eric W. "Bootstrap Methods." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/BootstrapMethods.html
- ↑ Notes for Earliest Known Uses of Some of the Words of Mathematics: Bootstrap (John Aldrich)
- ↑ Earliest Known Uses of Some of the Words of Mathematics (B) (Jeff Miller)
- ↑ Efron, B. (1979). "Bootstrap methods: Another look at the jackknife".
*The Annals of Statistics***7**(1): 1–26. doi:10.1214/aos/1176344552. - ↑ Quenouille M (1949) Approximate tests of correlation in time-series. J Roy Statist Soc Ser B 11 68–84
- ↑ Tukey J (1958) Bias and confidence in not-quite large samples (abstract). Ann Math Statist 29 614
- ↑ Jaeckel L (1972) The infinitesimal jackknife. Memorandum MM72-1215-11, Bell Lab
- ↑ Bickel P, Freeman D (1981) Some asymptotic theory for the bootstrap. Ann Statist 9 1196–1217
- ↑ Singh K (1981) On the asymptotic accuracy of Efron’s bootstrap. Ann Statist 9 1187–1195
- ↑ Rubin D (1981). The Bayesian bootstrap. Ann Statist 9 130–134
- ↑
^{14.0}^{14.1}^{14.2}Efron, B. (1987). "Better Bootstrap Confidence Intervals".*Journal of the American Statistical Association*(Journal of the American Statistical Association, Vol. 82, No. 397)**82**(397): 171–185. doi:10.2307/2289144. - ↑ Diciccio T, Efron B (1992) More accurate confidence intervals in exponential families. Biometrika 79 231–245
- ↑
^{16.0}^{16.1}^{16.2}"21 Bootstrapping Regression Models". https://www.sagepub.com/sites/default/files/upm-binaries/21122_Chapter_21.pdf. - ↑ DiCiccio TJ, Efron B (1996) Bootstrap confidence intervals (with Discussion). Statistical Science 11: 189–228
- ↑ Hinkley, David (1994-08-01). "[Bootstrap: More than a Stab in the Dark?: Comment"].
*Statistical Science***9**(3). doi:10.1214/ss/1177010387. ISSN 0883-4237. http://dx.doi.org/10.1214/ss/1177010387. - ↑ Goodhue, D.L., Lewis, W., & Thompson, R. (2012). Does PLS have advantages for small sample size or non-normal data? MIS Quarterly, 36(3), 981–1001.
- ↑ Efron, B., Rogosa, D., & Tibshirani, R. (2004). Resampling methods of estimation. In N.J. Smelser, & P.B. Baltes (Eds.). International Encyclopedia of the Social & Behavioral Sciences (pp. 13216–13220). New York, NY: Elsevier.
- ↑ Adèr, H. J., Mellenbergh G. J., & Hand, D. J. (2008).
*Advising on research methods: A consultant's companion*. Huizen, The Netherlands: Johannes van Kessel Publishing. ISBN:978-90-79418-01-5. - ↑ Bootstrap of the mean in the infinite variance case Athreya, K.B.
*Ann Stats*vol 15 (2) 1987 724–731 - ↑ Efron B., R. J. Tibshirani, An introduction to the bootstrap, Chapman & Hall/CRC 1998
- ↑ How many different bootstrap samples are there? Statweb.stanford.edu
- ↑ Jenkins, David G.; Quintana-Ascencio, Pedro F. (2020-02-21). "A solution to minimum sample size for regressions" (in en).
*PLOS ONE***15**(2): e0229345. doi:10.1371/journal.pone.0229345. ISSN 1932-6203. PMID 32084211. Bibcode: 2020PLoSO..1529345J. - ↑ Lumley, Thomas (2002). "The Importance of the Normality Assumption in Large Public Health Data Sets".
*Annual Review of Public Health***23**: 151–169. doi:10.1146/annurev.publhealth.23.100901.140546. PMID 11910059. - ↑ Li, Xiang; Wong, Wanling; Lamoureux, Ecosse L.; Wong, Tien Y. (2012-05-01). "Are Linear Regression Techniques Appropriate for Analysis When the Dependent (Outcome) Variable Is Not Normally Distributed?" (in en).
*Investigative Ophthalmology & Visual Science***53**(6): 3082–3083. doi:10.1167/iovs.12-9967. ISSN 1552-5783. PMID 22618757. https://iovs.arvojournals.org/article.aspx?articleid=2128171. - ↑ Rubin, D. B. (1981). "The Bayesian bootstrap".
*Annals of Statistics*, 9, 130. - ↑
^{29.0}^{29.1}WANG, SUOJIN (1995). "Optimizing the smoothed bootstrap".*Ann. Inst. Statist. Math.***47**: 65–80. doi:10.1007/BF00773412. - ↑
*A modern introduction to probability and statistics : understanding why and how*. Dekking, Michel, 1946-. London: Springer. 2005. ISBN 978-1-85233-896-1. OCLC 262680588. - ↑
^{31.0}^{31.1}^{31.2}Kirk, Paul (2009). "Gaussian process regression bootstrapping: exploring the effects of uncertainty in time course data".*Bioinformatics***25**(10): 1300–1306. doi:10.1093/bioinformatics/btp139. PMID 19289448. - ↑ Wu, C.F.J. (1986). "Jackknife, bootstrap and other resampling methods in regression analysis (with discussions)".
*Annals of Statistics***14**: 1261–1350. doi:10.1214/aos/1176350142. http://dml.cz/bitstream/handle/10338.dmlcz/135473/Kybernetika_38-2002-4_1.pdf. - ↑ Mammen, E. (Mar 1993). "Bootstrap and wild bootstrap for high dimensional linear models".
*Annals of Statistics***21**(1): 255–285. doi:10.1214/aos/1176349025. - ↑ Künsch, H. R. (1989). "The Jackknife and the Bootstrap for General Stationary Observations".
*Annals of Statistics***17**(3): 1217–1241. doi:10.1214/aos/1176347265. - ↑ Politis, D. N.; Romano, J. P. (1994). "The Stationary Bootstrap".
*Journal of the American Statistical Association***89**(428): 1303–1313. doi:10.1080/01621459.1994.10476870. - ↑ Vinod, HD (2006). "Maximum entropy ensembles for time series inference in economics".
*Journal of Asian Economics***17**(6): 955–978. doi:10.1016/j.asieco.2006.09.001. - ↑ Vinod, Hrishikesh; López-de-Lacalle, Javier (2009). "Maximum entropy bootstrap for time series: The meboot R package".
*Journal of Statistical Software***29**(5): 1–19. doi:10.18637/jss.v029.i05. - ↑ Cameron, A. C.; Gelbach, J. B.; Miller, D. L. (2008). "Bootstrap-based improvements for inference with clustered errors".
*Review of Economics and Statistics***90**(3): 414–427. doi:10.1162/rest.90.3.414. http://www.nber.org/papers/t0344.pdf. - ↑ Chamandy, N; Muralidharan, O; Najmi, A; Naidu, S (2012). "Estimating Uncertainty for Massive Data Streams". http://www.unofficialgoogledatascience.com/2015/08/an-introduction-to-poisson-bootstrap26.html.
- ↑ Hanley, James A., and Brenda MacGibbon. "Creating non-parametric bootstrap samples using Poisson frequencies." computer methods and programs in biomedicine 83.1 (2006): 57-62. pdf
- ↑ Babu, G. Jogesh, P. K. Pathak, and C. R. Rao. "Second-order correctness of the Poisson bootstrap." The Annals of Statistics 27.5 (1999): 1666-1683. link
- ↑ Shoemaker, Owen J., and P. K. Pathak. "The sequential bootstrap: a comparison with regular bootstrap." Communications in Statistics-Theory and Methods 30.8-9 (2001): 1661-1674. link
- ↑ Jiménez-Gamero, María Dolores, Joaquín Muñoz-García, and Rafael Pino-Mejías. "Reduced bootstrap for the median." Statistica Sinica (2004): 1179-1198. link
- ↑ Kleiner, A; Talwalkar, A; Sarkar, P; Jordan, M. I. (2014). "A scalable bootstrap for massive data".
*Journal of the Royal Statistical Society, Series B (Statistical Methodology)***76**(4): 795–816. doi:10.1111/rssb.12050. ISSN 1369-7412. - ↑
^{45.0}^{45.1}Davison, A. C.; Hinkley, D. V. (1997).*Bootstrap methods and their application*. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press. software. ISBN 0-521-57391-2. - ↑
^{46.0}^{46.1}^{46.2}Hesterberg, Tim C (2014). "What Teachers Should Know about the Bootstrap: Resampling in the Undergraduate Statistics Curriculum". arXiv:1411.5279 [stat.OT]. - ↑ Efron, B. (1982).
*The jackknife, the bootstrap, and other resampling plans*.**38**. Society of Industrial and Applied Mathematics CBMS-NSF Monographs. ISBN 0-89871-179-7. - ↑ Scheiner, S. (1998).
*Design and Analysis of Ecological Experiments*. CRC Press. ISBN 0412035618. https://archive.org/details/designanalysisof0000unse. - ↑ Rice, John.
*Mathematical Statistics and Data Analysis*(2 ed.). p. 272. "Although this direct equation of quantiles of the bootstrap sampling distribution with confidence limits may seem initially appealing, it’s rationale is somewhat obscure." - ↑ Data from examples in
*Bayesian Data Analysis* - ↑ Chihara, Laura; Hesterberg, Tim (3 August 2018).
*Mathematical Statistics with Resampling and R*(2nd ed.). John Wiley & Sons, Inc.. ISBN 9781119416548. https://onlinelibrary.wiley.com/doi/book/10.1002/9781119505969. - ↑ Young, G. A. (July 1990). "Alternative Smoothed Bootstraps".
*Journal of the Royal Statistical Society, Series B (Methodological)***52**(3): 477–484. doi:10.1111/j.2517-6161.1990.tb01801.x. ISSN 0035-9246. http://dx.doi.org/10.1111/j.2517-6161.1990.tb01801.x.

## Further reading

- Diaconis, P.; Efron, B. (May 1983). "Computer-intensive methods in statistics".
*Scientific American***248**(5): 116–130. doi:10.1038/scientificamerican0583-116. Bibcode: 1983SciAm.248e.116D. https://statistics.stanford.edu/sites/default/files/BIO%2083.pdf. popular-science - Efron, B. (1981). "Nonparametric estimates of standard error: The jackknife, the bootstrap and other methods".
*Biometrika***68**(3): 589–599. doi:10.1093/biomet/68.3.589. - Hesterberg, T. C.; D. S. Moore; S. Monaghan; A. Clipson; R. Epstein (2005). "Bootstrap methods and permutation tests". in David S. Moore.
*Introduction to the Practice of Statistics*. software. http://bcs.whfreeman.com/ips5e/content/cat_080/pdf/moore14.pdf. Retrieved 2007-03-23. - Efron, Bradley (1979). "Bootstrap methods: Another look at the jackknife".
*The Annals of Statistics***7**: 1–26. doi:10.1214/aos/1176344552. http://projecteuclid.org/DPubS/Repository/1.0/Disseminate?view=body&id=pdf_1&handle=euclid.aos/1176344552. - Efron, Bradley (1981). "Nonparametric estimates of standard error: The jackknife, the bootstrap and other methods".
*Biometrika***68**(3): 589–599. doi:10.2307/2335441. - Efron, Bradley (1982).
*The jackknife, the bootstrap, and other resampling plans*, In*Society of Industrial and Applied Mathematics CBMS-NSF Monographs*, 38. - Diaconis, P.; Efron, Bradley (1983), "Computer-intensive methods in statistics,"
*Scientific American*, May, 116–130. - Efron, Bradley; Tibshirani, Robert J. (1993).
*An introduction to the bootstrap*, New York: Chapman & Hall, software. - Davison, A. C. and Hinkley, D. V. (1997): Bootstrap Methods and their Application, software.
- Mooney, C Z & Duval, R D (1993). Bootstrapping. A Nonparametric Approach to Statistical Inference. Sage University Paper series on Quantitative Applications in the Social Sciences, 07-095. Newbury Park, CA: Sage.
- Simon, J. L. (1997): Resampling: The New Statistics.
- Wright, D.B., London, K., Field, A.P. Using Bootstrap Estimation and the Plug-in Principle for Clinical Psychology Data. 2011 Textrum Ltd. Online: https://www.researchgate.net/publication/236647074_Using_Bootstrap_Estimation_and_the_Plug-in_Principle_for_Clinical_Psychology_Data. Retrieved on 25/04/2016.
- An Introduction to the Bootstrap. Monographs on Statistics and applied probability 57. Chapman&Hall/CHC. 1998. Online https://books.google.it/books?id=gLlpIUxRntoC&pg=PA35&lpg=PA35&dq=plug+in+principle&source=bl&ots=A8AsW5K6E2&sig=7WQVzL3ujAnWC8HDNyOzKlKVX0k&hl=en&sa=X&sqi=2&ved=0ahUKEwiU5c-Ho6XMAhUaOsAKHS_PDJMQ6AEIPDAG#v=onepage&q=plug%20in%20principle&f=false. Retrieved on 25 04 2016.

## External links

- Bootstrap sampling tutorial using MS Excel
- Bootstrap example to simulate stock prices using MS Excel
- bootstrapping tutorial
- What is the bootstrap?

### Software

- Statistics101: Resampling, Bootstrap, Monte Carlo Simulation program. Free program written in Java to run on any operating system.

Original source: https://en.wikipedia.org/wiki/ Bootstrapping (statistics).
Read more |