Bootstrap count vectors 2026-10-14
An unordered nonparametric bootstrap sample from distinct observations is specified by its nonnegative multiplicities. Stars and bars gives such vectors. They are not equiprobable: a vector has probability , because this counts its ordered sequences of sampled indices.
For a continuous uniform distribution on , the scaled maximum gap tends to a unit-rate exponential distribution. An ordinary bootstrap sample includes the unique observed maximum with probability . The bootstrap maximum gap therefore retains an atom at zero, whereas the target limit is continuous. This proves failure of the ordinary empirical bootstrap for this endpoint functional; consistency of the endpoint estimate alone does not justify resampling its extreme-value limit.
Bootstrap standard error 2026-10-14
Replace the unknown sampling distribution by the empirical distribution, generate independent bootstrap samples, and recompute the statistic. The sample standard deviation of those recomputed values estimates the conditional bootstrap standard deviation, which approximates the statistic's sampling standard error when the bootstrap is consistent. It is different from the Monte Carlo standard error of the estimated bootstrap mean.
For each bootstrap sample, form , using that sample's estimated standard error, possibly from a nested bootstrap. If are conditional quantiles of and is the original estimated standard error, invert the studentized inequalities to obtain the displayed interval. The quantile order is reversed by subtraction. Its coverage is approximate and requires a nondegenerate statistic and suitable bootstrap regularity.
For , independence and the uniform distribution give . Consequently, for fixed and ,
For the survival probability is one. Thus the scaled endpoint gap converges in distribution to a unit-rate exponential law; it is not exactly exponential at finite .
The plug-in estimator principle replaces the unknown sampling distribution by its empirical distribution and evaluates its population functional at that fitted distribution. Here the fitted support endpoint is , also the maximum-likelihood estimate: the likelihood is and decreases over its allowed support. For an empirical bootstrap sample , the corresponding gap is
Almost surely the original maximum is unique. The bootstrap gap equals zero precisely when this observation is selected at least once, so
The true limiting exponential distribution has no atom at zero. This nonvanishing discrepancy proves bootstrap failure for a uniform endpoint: the bootstrap distribution cannot converge to the correct limit, even though the endpoint estimate itself is consistent. It fails to recreate the unsampled population tail beyond the observed maximum. A parametric bootstrap drawing from , rather than from the discrete empirical sample, reproduces the scaled-gap law here.
The nonparametric bootstrap replaces the unknown sampling law by the empirical distribution
Generate independent bootstrap samples, each containing independent draws with replacement from that law. Recompute the original estimator in each sample, obtaining . With , the bootstrap standard error estimate is
This estimates the conditional bootstrap standard deviation, which approximates the estimator's sampling standard deviation when the bootstrap is consistent. Dividing this expression by would instead estimate the Monte Carlo error in the bootstrap mean, a different quantity.
For distinct original observations, each resample is an ordered index sequence with one of equally likely values. It contains no repeats precisely when it is a permutation of all original indices, giving possibilities. Hence
The distinctness assumption is needed to equate repeated values with repeated indices.
Set , and . The fourth-moment assumption makes finite, so the variance of a sample mean is . Assume , as required for leave-one-out estimation.
The Jackknife variance estimator recomputes the original statistic on each sample with one observation removed. Here
By the definition of the Jackknife variance estimator,
For completeness, expanding the centered sum gives
Consequently . The jackknife variance estimator is unbiased for this statistic. This calculation uses only the finite fourth moment, not normality of the original observations.
Given the observed data, put and . The empirical distribution assigns mass to each observed , including repeated values with their multiplicities. A bootstrap sample consists of independent draws from this distribution, with replacement. The nonparametric bootstrap variance estimate is the conditional variance
Independence of the bootstrap draws gives the exact conditional bootstrap variance of a sample mean:
Thus its finite-sample expectation is , in contrast to the unbiased jackknife estimate. This is the jackknife and bootstrap variance of a sample second moment scaling difference.
To approximate it by Monte Carlo simulation, independently generate bootstrap samples. For replicate , choose independent uniform indices and compute . With , use
For this is conditionally unbiased for the bootstrap variance and converges to it as . Uniform indices can be obtained by for uniforms on .
Let be the conditional bootstrap distribution of the statistic. A nominal level percentile bootstrap confidence interval is
Reuse the bootstrap replicates, sort them as , and take the order statistics with ranks and as empirical quantiles. These are quantiles of the statistic itself, rather than reflected quantiles of its centered error. Increasing reduces simulation error; it does not turn an approximate confidence interval into an exact finite-sample one.
An analytic alternative follows from the central limit theorem. If , then , and the sample variance converges to by the strong law of large numbers. The Slutsky theorem therefore gives the large-sample normal approximation interval
where is the standard normal quantile. Its lower endpoint may be truncated to zero because the parameter is nonnegative. If , almost surely and the statistic identifies the parameter exactly; the interval degenerates to that value. The nondegenerate normal interval is asymptotic, not an exact Student interval under arbitrary .
For jackknife resampling, calculate the leave-one-out estimates by deleting observation , and their average . The jackknife variance estimator is
The factor compensates for the small differences between the overlapping samples. For sufficiently smooth statistics it estimates their sampling variance. The related estimated bias is , leading to the jackknife bias correction .
For the nonparametric bootstrap, replace the unknown distribution by its empirical distribution function
Independently sample observations with replacement from the original observations, compute the estimator on that bootstrap sample, and repeat this for independently generated bootstrap samples. If the resulting values are , estimate the conditional bootstrap variance by
Its interpretation as an approximation to the original sampling variance relies on the bootstrap approximating the sampling law of the statistic; increasing only reduces simulation error and cannot repair a failure of that approximation.
Since the original observations are distinct, a bootstrap sample has no repeated value precisely when it contains all original values once. Of the equally likely ordered resamples, are permutations without repetition. Therefore
The probability is zero for and rapidly approaches one as grows.
The first matrix contains the leave-one-out samples, and each element of vect is their sample mean. For ,
Thus R4a computes the jackknife variance estimator of the full sample mean:
where is the unbiased sample variance. R5a computes the estimated bias used in jackknife bias correction. The identity for the average leave-one-out sample mean gives R5a = 0, apart from floating-point rounding.
The second printed loop contains an indexing error: its row index is i, although its loop variable is b. Literally, after the first block, i equals . When , every iteration overwrites row of the new matrix; the other rows remain missing. Hence vect contains one finite mean and 198 missing entries. R's default sorting removes missing entries, leaving a vector of length one, so selecting its fifth and 195th entries gives R7b = c(NA, NA). If , the matrix assignment is out of bounds; if the second block runs independently with i undefined, it fails even earlier. This is a source error, not a property of the bootstrap.
Replacing just the row index by b gives the intended algorithm: draw 199 independent bootstrap samples and sort their sample means as . The two indices are and , so
These are the endpoints of an approximate 95% percentile bootstrap confidence interval for the population mean. Their actual numerical values depend on the supplied data and random draws, which are not specified. They are not the reflected endpoints of a basic bootstrap confidence interval, and the choice of ranks does not guarantee exact finite-sample coverage.
An unordered bootstrap sample is determined by the multiplicities of the distinct observations, with . Conversely each such vector specifies exactly one sample up to rearrangement. Place identical marks into boxes using separators. The stars and bars argument therefore gives
These bootstrap count vectors are not equally likely: the probability of a vector is , counting its possible ordered sequences. The ordered index sequences themselves number .
The first simulation uses independent standard Cauchy distributions and returns
The tail probability and estimator moments are
The indicator count has a binomial distribution with parameters ; the infinite variance of a Cauchy observation is irrelevant because this estimator averages bounded indicators.
For the next code block, each row is an independent sample of size from the empirical distribution of the original . Its entry in the vector is the corresponding bootstrap indicator mean . The last expression is the variance of these replicate estimates, with denominator :
Condition on the original data and write a star on bootstrap expectations. Every resampled indicator has a Bernoulli distribution with success probability , and the draws within a row are independent. Thus the conditional bootstrap variance of a sample mean gives
It estimates the sampling variance of the tail-probability estimator, not the variance of the raw Cauchy data. Its square root is an estimated standard error. Finite leaves bootstrap simulation noise. Averaging over the original data, its expectation is , so it is not exactly unbiased for the true variance at finite .
In the importance-sampling block, the transformation gives, for ,
The variable is a proposal draw supported entirely in the integration region. The deterministic value computed from it is the importance sampling weight
Consequently
The code uses ordinary importance sampling of a Cauchy tail, not self-normalization; itself is neither an observation from the target Cauchy law nor the estimator's summand. The weight compensates for sampling from its proposal law.
The final block bootstraps these same proposal observations and recomputes the weight average in each row. Since is a deterministic function of , this is equivalent to resampling the observed weights . If denotes a replicate, the final output is its sample variance over the replicates. Its conditional expectation is
Its expectation over the original proposal sample is .
The variance reduction can be calculated, rather than inferred just from the appearance of the weights. Write . Then
because an antiderivative of the integrand without its prefactor is . Hence
By comparison, . For the true estimator variances are approximately and respectively. The importance estimator has about 1/1,317 of the indicator estimator's variance, because all proposals land in the tail and the weights remain in the narrow interval .
Thus the last bootstrap output should usually be much smaller than the first, and its expected value is smaller by the same variance ratio. This is not a deterministic ordering of two finite-run outputs: if all the original Cauchy draws happen to be at most two, the first bootstrap variance is zero, while unequal importance weights can still give a positive second variance.
The nonparametric bootstrap sample is a sample of size drawn independently with replacement from the empirical distribution , conditional on the observed data. To simulate it, take independent uniform and set , assigning to the last index if it occurs in a finite-precision generator.
Let be the conditional cumulative distribution function of , and let . A basic bootstrap confidence interval is
In practice the conditional quantiles are estimated from many simulated bootstrap means; the asymptotic argument below describes exact bootstrap quantiles or a simulation count tending to infinity.
For the required uniform-convergence fact, given choose with and . By continuity, choose a finite mesh on with successive increases of less than . Pointwise convergence at the mesh points makes there for large . Monotonicity sandwiches both functions between their neighbouring mesh values, so throughout . The same monotonicity and the chosen tail bounds control the two exterior rays by . Hence .
The bootstrap consistency theorem for the sample mean states that, for iid observations with , the conditional law of converges weakly, in probability, to . By continuity of that limiting distribution and the preceding monotonicity argument, the convergence of conditional distribution functions is uniform in probability. Since the limit is strictly increasing, in probability for . The coverage event is
The central limit theorem, quantile convergence and Slutsky theorem therefore give .
Positive variance is needed for this exact coverage conclusion. If the finite variance allowed in the wording is zero, all observations equal almost surely and the interval collapses to , with coverage one. The bootstrap distribution is still consistent with the degenerate limit, but a nonrandomized usual interval cannot then have limiting coverage for .
A random forest fits each of its classification trees to an independent bootstrap sample of the nine observations. At each node it draws mtry=2 candidate coordinates; because the data have exactly two coordinates, both are available, and a CART impurity calculation chooses the split. The trees are grown deeply without ordinary cost-complexity pruning, and their majority vote is the forest prediction.
R reports an out-of-bag error estimate: an observation is predicted only by trees whose bootstrap samples omitted it. The confusion matrix says that class 1 has three correct and three incorrect out-of-bag predictions, while class 2 has one correct and two incorrect predictions. Hence the total out-of-bag error is .
The loop performs Leave-one-out cross-validation: for each it fits a forest to the other eight observations, tests it on observation , and averages the nine zero-one losses. A random forest's out-of-bag error estimate approximates the same held-out prediction error from one fit, because each tree automatically omits roughly a proportion of the observations in its bootstrap sample.