
Bootstrap-based Inference
Source:R/inference_all_abstract_non_param_boot.R
InferenceNonParamBootstrap.RdAbstract class for bootstrap-based inference.
The default m = NULL rule is a cheap deterministic
intermediate sequence: \(m \to \infty\) and \(m / n \to 0\), as
required by the standard m-out-of-n bootstrap asymptotic setup
(Bickel, Gotze, and van Zwet; Bickel and Sakov). The exponent 0.7 is a
pragmatic interior point in \((0, 1)\); it is not a silver-bullet
optimal choice. Use select_optimal_m_out_of_n_bootstrap() for
data-adaptive minimum-volatility selection.
The default m = NULL follows the intermediate-sequence
convention from the m-out-of-n bootstrap literature:
\(m \to \infty\) and \(m / n \to 0\). The deterministic exponent
0.7 is a first-pass default; for unstable paths prefer the
minimum-volatility selector.
The NULL default is grounded in the standard m-out-of-n
asymptotic condition \(m \to \infty\) and \(m / n \to 0\). The
minimum-volatility selector is available when a fixed deterministic
exponent is too brittle for a specific estimator/design path.
This implements the same minimum-volatility idea used in PTE's m-selection workflow: scan admissible intermediate sizes and choose a stable region of the target statistic rather than assuming one exponent is uniformly optimal.
The default b = NULL rule is a cheap deterministic
intermediate sequence: \(b \to \infty\) and \(b / n \to 0\), as
required by the Politis, Romano, and Wolf subsampling framework. The
exponent 0.7 is a pragmatic interior point in \((0, 1)\); it is not a
universal optimum. Use select_optimal_b_subsampling() for
data-adaptive minimum-volatility selection.
The default b = NULL follows the intermediate-sequence
convention from the Politis/Romano/Wolf subsampling literature:
\(b \to \infty\) and \(b / n \to 0\). The deterministic exponent
0.7 is a first-pass default; for unstable paths prefer the
minimum-volatility selector.
The NULL default is grounded in the standard
Politis/Romano/Wolf asymptotic condition \(b \to \infty\) and
\(b / n \to 0\). The minimum-volatility selector is available when a
fixed deterministic exponent is too brittle for a specific
estimator/design path.
This implements the same minimum-volatility idea used in PTE's m-selection workflow, applied to the PRW block/subsample-size choice: scan admissible intermediate sizes and choose a stable region of the target statistic rather than assuming one exponent is uniformly optimal.
Design-specific validity caveats for the nonparametric bootstrap
The nonparametric bootstrap resamples experimental units with replacement from their
empirical distribution, carrying each unit's realized (x, w, y) into the
replicate, and recomputes the estimator. Its validity rests on the resampled units
being (approximately) iid draws from the design's unit-level superpopulation. Since
covariate-adaptive designs induce dependence among the assignments \(w_i\) (and
between \(w\) and \(X\)), the appropriate resampling unit and the fidelity with
which the design's dependence is replicated differ by design. In all cases below the
inference is asymptotic, never finite-sample exact (for exact finite-sample inference
under the design's actual randomization mechanism, use the randomization tests and
randomization confidence intervals instead). Where a balance constraint of the design
is broken by resampling, the bootstrap variance is inflated relative to the design's
true sampling variance, so tests and intervals err conservative
(over-coverage), not anti-conservative.
DesignFixedBernoulli,DesignSeqOneByOneBernoulliAssignments are iid coin flips independent of \(X\), so rows genuinely are iid and row-level resampling is fully justified. No caveat.
DesignFixediBCRD,DesignSeqOneByOneiBCRDAssignment depends only on the treatment counts (completely randomized / without-replacement urn), inducing negative correlation among the \(w_i\) through the fixed-margin constraint. Row-level iid resampling does not replicate this constraint: replicates have a random number of treated subjects. The extra variability is \(O(1/n)\), so the bootstrap is conservative by an asymptotically negligible amount.
DesignSeqOneByOneEfron,DesignSeqOneByOneUrnAssignment depends on the running treatment imbalance (not on \(X\)), inducing serial negative dependence among the \(w_i\). Row-level resampling ignores this dependence; as with fixed margins the effect on smooth estimators is \(O(1/n)\), so the bootstrap is conservative by a negligible amount.
DesignSeqOneByOneRandomBlockSize(no strata)Permuted-block balance over entry order is broken by row-level resampling. Conservative, minor: only the counts constraint is lost since the design does not use \(X\).
DesignSeqOneByOneRandomBlockSize(with strata),DesignSeqOneByOneSPBRResampling is within-strata, preserving stratum sizes and the stratum-covariate composition. The within-block time-order balance inside each stratum is still broken, so replicates have random within-stratum treatment counts. Conservative, minor.
DesignFixedBlockingResampling is within-strata by default (
bootstrap_type = "within_blocks"), preserving stratum sizes; the exact within-stratum treatment/control split is not enforced in replicates, so the block-randomization variance reduction is partially unreplicated. Conservative, minor.bootstrap_type = "resample_blocks"instead resamples whole blocks, preserving within-block composition at the price of fewer resampling atoms.DesignFixedOptimalBlocksSame within-block resampling caveats as
DesignFixedBlocking, plus the blocks themselves are computed from the realized covariate sample: the block structure is a global function of the data that the bootstrap conditions on rather than re-derives. The justification for this conditioning is asymptotic: as \(n\) grows the blocking depends on the sample only through the (convergent) empirical distribution of \(X\), so between-block dependence vanishes. Conservative.DesignFixedClusterAssignment is at the cluster level and outcomes are correlated within clusters, so whole clusters are resampled with replacement. This is the correct exchangeable unit; with few clusters the bootstrap distribution rests on few resampling atoms and becomes unstable. Asymptotics are in the number of clusters, not the number of subjects.
DesignFixedBlockedClusterClusters are resampled within strata, matching both levels of the design's dependence (stratum and cluster). Sound, with the same small-sample caution: few clusters per stratum means few resampling atoms per stratum, and asymptotics are in the number of clusters.
DesignSeqOneByOnePocockSimonMinimization makes each assignment a near-deterministic function of the running stratum-count imbalances. Row-level iid resampling does not replicate this balance-forcing, so the bootstrap variance corresponds to iid assignment rather than the (smaller) minimization-design variance (cf. Bugni, Canay & Shah 2018). Conservative, with the largest expected over-coverage among the sequential designs.
DesignSeqOneByOneAtkinsonThe biased-coin \(D_A\)-optimal rule makes \(w_i\) depend on the full covariate and assignment history, and conditional assignment probabilities differ from 1/2. Row-level resampling does not replicate the covariate balance the rule enforces. Conservative, moderate.
DesignFixedGreedyDOptimal,DesignFixedGreedy,DesignFixedRerandomizationThe observed \(w\) vector is one draw from a tightly constrained (optimized or acceptance-sampled) set of allocations. Resampled replicates carry per-row assignments whose recombined \(w\) vector no longer satisfies the balance constraint, so the bootstrap reflects the variance of unconstrained assignment (cf. Li, Ding & Rubin 2018 for rerandomization). Conservative, moderate-to-large: the stronger the optimization, the greater the over-coverage.
DesignFixedMatchingGreedyPairSwitchingThe greedy switching search only ever flips assignments within binary-match pairs, so every pair has exactly one treated subject; the bootstrap resamples intact pairs, preserving the within-pair anticorrelation. Remaining caveats: the pairing is a global function of the sample (conditioned on, justified asymptotically as for the matched designs below), and the greedy choice of which pair member is treated couples the pairs, which resampling does not replicate — the residual effect errs conservative.
DesignFixedBinaryMatchMatched pairs are resampled intact, preserving the within-pair anticorrelation of \(w\) and the pair-level variance reduction. The pairing itself is a global function of the covariate sample (an Abadie & Imbens 2008-type concern): pairs are exchangeable but not exactly independent. Validity is asymptotic — as \(n\) grows the pairing depends on the sample only through the empirical distribution of \(X\) and between-pair dependence vanishes — and the bootstrap conditions on the realized match structure.
DesignSeqOneByOneKK14Matched pairs and reservoir subjects are resampled separately as intact units, preserving within-pair anticorrelation and the reservoir's Bernoulli assignments. Same asymptotic caveats as the fixed matched designs, plus the split between number of pairs and reservoir size is treated as fixed rather than random. Sound asymptotically.
DesignSeqOneByOneKK21,DesignSeqOneByOneKK21stepwiseAll
DesignSeqOneByOneKK14caveats apply, plus the matching weights are estimated from earlier responses, so \(W\) depends on \(y\) as well as \(X\). The bootstrap conditions on the realized response-adaptive weights and match structure rather than replicating their sampling variability; this extra conditioning is not quantified, and validity remains asymptotic.DesignFixedFactorialRow-level resampling does not replicate the balanced allocation across factor combinations. Conservative, minor.
DesignFixedCustom,DesignCustomSequentialWarning: iid row-level resampling is used because the package has no knowledge of the user-supplied assignment mechanism. If that mechanism balances on covariates, the bootstrap is likely conservative; if it induces clustering or other positive dependence, the bootstrap may not even be valid (anti-conservative). Use the randomization-based inference, which draws from the actual custom mechanism, whenever possible.
References
Bickel, P. J., Gotze, F., and van Zwet, W. R. (1997). Resampling fewer than n observations: gains, losses, and remedies for losses. Statistica Sinica.
Bickel, P. J. and Sakov, A. (2008). On the choice of m in the m out of n bootstrap. The Annals of Statistics.
Politis, D. N., Romano, J. P., and Wolf, M. (1999). Subsampling. Springer.
Super classes
Inference -> InferenceRand -> InferenceRandCI -> InferenceNonParamBootstrap
Methods
Public methods
InferenceNonParamBootstrap$get_supported_bootstrap_pval_types()InferenceNonParamBootstrap$get_supported_bootstrap_ci_types()InferenceNonParamBootstrap$approximate_m_out_of_n_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval()InferenceNonParamBootstrap$select_optimal_m_out_of_n_bootstrap()InferenceNonParamBootstrap$approximate_subsampling_distribution_beta_hat_T()InferenceNonParamBootstrap$compute_subsampling_two_sided_pval()InferenceNonParamBootstrap$compute_subsampling_confidence_interval()InferenceNonParamBootstrap$compute_subsampling_sensitivity()InferenceNonParamBootstrap$approximate_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_bootstrap_confidence_interval()
+ inherited public methods from InferenceRandCI
InferenceRandCI$compute_rand_confidence_interval()InferenceRandCI$compute_rand_two_sided_pval()+ inherited public methods from InferenceRand
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_asymp_confidence_interval()Inference$compute_asymp_two_sided_pval()Inference$compute_estimate()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$initialize()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceNonParamBootstrap$get_supported_bootstrap_pval_types()
Returns the type values
compute_bootstrap_two_sided_pval() accepts.
InferenceNonParamBootstrap$get_supported_bootstrap_ci_types()
Returns the type values
compute_bootstrap_confidence_interval() accepts.
InferenceNonParamBootstrap$approximate_m_out_of_n_bootstrap_distribution_beta_hat_T()
Creates the m-out-of-n bootstrap distribution of the treatment-effect estimate.
Usage
InferenceNonParamBootstrap$approximate_m_out_of_n_bootstrap_distribution_beta_hat_T(
B = 501,
m = NULL,
show_progress = TRUE,
debug = FALSE,
bootstrap_type = NULL,
scaling = "sqrt_n",
center = "full_estimate"
)Arguments
BNumber of resamples. Default 501.
mNumber of exchangeable resampling units drawn with replacement. If
NULL(default), use the deterministic intermediate-size rulefloor(n_units^0.7), wheren_unitsis the number of exchangeable units used by the design (observations, clusters, pairs, or matched sets). The resolved value must satisfymax(5, p_eff + 2) <= m <= floor(n_units / 2).show_progressA flag indicating whether a progress bar should be displayed.
debugIf
TRUE, return distribution diagnostics in addition to the resampled estimates.bootstrap_typeOptional empirical-resampling scheme. See
approximate_bootstrap_distribution_beta_hat_T().scalingScaling sequence for centered m-out-of-n pivots. The default
"sqrt_n"usessqrt(m)for the m-sample distribution and converts back to the full-sample scale usingsqrt(n_units).centerCentering convention for diagnostics and cache keys.
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval()
Computes a centered m-out-of-n bootstrap two-sided p-value.
Usage
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval(
delta = 0,
B = 501,
m = NULL,
type = "centered",
show_progress = TRUE,
min_number_usable_samples = 5L,
bootstrap_type = NULL,
scaling = "sqrt_n"
)Arguments
deltaNull treatment effect. Default 0.
BNumber of resamples. Default 501.
mNumber of exchangeable units drawn with replacement. If
NULL(default), usefloor(n_units^0.7)subject to the validation bounds documented forapproximate_m_out_of_n_bootstrap_distribution_beta_hat_T().typeP-value type. Currently only
"centered"is supported.show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite resampled estimates required after filtering. Default 5.
bootstrap_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered m-out-of-n pivots.
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval()
Computes a basic m-out-of-n bootstrap confidence interval.
Usage
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval(
alpha = 0.05,
B = 501,
m = NULL,
type = "basic",
show_progress = TRUE,
min_number_usable_samples = 5L,
bootstrap_type = NULL,
scaling = "sqrt_n"
)Arguments
alphaSignificance level. Default 0.05.
BNumber of resamples. Default 501.
mNumber of exchangeable units drawn with replacement. If
NULL(default), usefloor(n_units^0.7)subject to the validation bounds documented forapproximate_m_out_of_n_bootstrap_distribution_beta_hat_T().typeConfidence-interval type. Currently only
"basic"is supported.show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite resampled estimates required after filtering. Default 5.
bootstrap_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered m-out-of-n pivots.
InferenceNonParamBootstrap$select_optimal_m_out_of_n_bootstrap()
Selects an m-out-of-n bootstrap size by minimum volatility.
Usage
InferenceNonParamBootstrap$select_optimal_m_out_of_n_bootstrap(
B = 251,
alpha = 0.05,
m_pow_of_n_grid = seq(0.5, 0.9, by = 0.05),
m_grid = NULL,
objective = "ci_width",
target = "ci",
volatility_window = 3L,
bootstrap_type = NULL,
scaling = "sqrt_n",
show_progress = TRUE,
min_finite_fraction = 0.8
)Arguments
BNumber of resamples per candidate size. Default 251.
alphaSignificance level for interval-width objectives.
m_pow_of_n_gridCandidate exponent grid used when
m_grid = NULL. Defaults toseq(0.5, 0.9, by = 0.05).m_gridOptional explicit integer candidate sizes.
objectiveSelection objective. Currently
"ci_width".targetTarget summary. Currently
"ci".volatility_windowRolling window size used to measure local volatility across candidate sizes.
bootstrap_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered m-out-of-n pivots.
show_progressA flag indicating whether a progress bar should be displayed.
min_finite_fractionMinimum finite-resample fraction required for a candidate size to be eligible.
InferenceNonParamBootstrap$approximate_subsampling_distribution_beta_hat_T()
Creates the Politis/Romano/Wolf subsampling distribution of the treatment-effect estimate.
Usage
InferenceNonParamBootstrap$approximate_subsampling_distribution_beta_hat_T(
B = 501,
b = NULL,
show_progress = TRUE,
debug = FALSE,
subsampling_type = NULL,
scaling = "sqrt_n",
center = "full_estimate"
)Arguments
BNumber of subsamples. Default 501.
bNumber of exchangeable units drawn without replacement. If
NULL(default), use the deterministic intermediate-size rulefloor(n_units^0.7), wheren_unitsis the number of exchangeable units used by the design (observations, clusters, pairs, or matched sets). The resolved value must satisfymax(5, p_eff + 2) <= b <= floor(n_units / 2).show_progressA flag indicating whether a progress bar should be displayed.
debugIf
TRUE, return distribution diagnostics in addition to the subsampled estimates.subsampling_typeOptional empirical-resampling scheme. See
approximate_bootstrap_distribution_beta_hat_T().scalingScaling sequence for centered subsampling pivots. The default
"sqrt_n"usessqrt(b)for the subsample distribution and converts back to the full-sample scale usingsqrt(n_units).centerCentering convention for diagnostics and cache keys.
InferenceNonParamBootstrap$compute_subsampling_two_sided_pval()
Computes a centered PRW subsampling two-sided p-value.
Usage
InferenceNonParamBootstrap$compute_subsampling_two_sided_pval(
delta = 0,
B = 501,
b = NULL,
type = "centered",
show_progress = TRUE,
min_number_usable_samples = 5L,
subsampling_type = NULL,
scaling = "sqrt_n"
)Arguments
deltaNull treatment effect. Default 0.
BNumber of subsamples. Default 501.
bNumber of exchangeable units drawn without replacement. If
NULL(default), usefloor(n_units^0.7)subject to the validation bounds documented forapproximate_subsampling_distribution_beta_hat_T().typeP-value type. Currently only
"centered"is supported.show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite subsampled estimates required after filtering. Default 5.
subsampling_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered subsampling pivots.
InferenceNonParamBootstrap$compute_subsampling_confidence_interval()
Computes a basic PRW subsampling confidence interval.
Usage
InferenceNonParamBootstrap$compute_subsampling_confidence_interval(
alpha = 0.05,
B = 501,
b = NULL,
type = "basic",
show_progress = TRUE,
min_number_usable_samples = 5L,
subsampling_type = NULL,
scaling = "sqrt_n"
)Arguments
alphaSignificance level. Default 0.05.
BNumber of subsamples. Default 501.
bNumber of exchangeable units drawn without replacement. If
NULL(default), usefloor(n_units^0.7)subject to the validation bounds documented forapproximate_subsampling_distribution_beta_hat_T().typeConfidence-interval type. Currently only
"basic"is supported.show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite subsampled estimates required after filtering. Default 5.
subsampling_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered subsampling pivots.
InferenceNonParamBootstrap$select_optimal_b_subsampling()
Selects a PRW subsampling size by minimum volatility.
Usage
InferenceNonParamBootstrap$select_optimal_b_subsampling(
B = 251,
alpha = 0.05,
b_pow_of_n_grid = seq(0.5, 0.9, by = 0.05),
b_grid = NULL,
objective = "ci_width",
target = "ci",
volatility_window = 3L,
subsampling_type = NULL,
scaling = "sqrt_n",
show_progress = TRUE,
min_finite_fraction = 0.8
)Arguments
BNumber of subsamples per candidate size. Default 251.
alphaSignificance level for interval-width objectives.
b_pow_of_n_gridCandidate exponent grid used when
b_grid = NULL. Defaults toseq(0.5, 0.9, by = 0.05).b_gridOptional explicit integer candidate sizes.
objectiveSelection objective. Currently
"ci_width".targetTarget summary. Currently
"ci".volatility_windowRolling window size used to measure local volatility across candidate sizes.
subsampling_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered subsampling pivots.
show_progressA flag indicating whether a progress bar should be displayed.
min_finite_fractionMinimum finite-subsample fraction required for a candidate size to be eligible.
InferenceNonParamBootstrap$compute_subsampling_sensitivity()
Computes PRW subsampling sensitivity over candidate sizes.
Usage
InferenceNonParamBootstrap$compute_subsampling_sensitivity(
B = 251,
alpha = 0.05,
b_pow_of_n_grid = seq(0.5, 0.9, by = 0.05),
b_grid = NULL,
objective = "ci_width",
target = "ci",
volatility_window = 3L,
subsampling_type = NULL,
scaling = "sqrt_n",
show_progress = TRUE,
min_finite_fraction = 0
)Arguments
BNumber of subsamples per candidate size. Default 251.
alphaSignificance level for interval-width objectives.
b_pow_of_n_gridCandidate exponent grid used when
b_grid = NULL. Defaults toseq(0.5, 0.9, by = 0.05).b_gridOptional explicit integer candidate sizes.
objectiveSelection objective. Currently
"ci_width".targetTarget summary. Currently
"ci".volatility_windowRolling window size used to measure local volatility across candidate sizes.
subsampling_typeOptional empirical-resampling scheme.
scalingScaling sequence for centered subsampling pivots.
show_progressA flag indicating whether a progress bar should be displayed.
min_finite_fractionMinimum finite-subsample fraction required for a candidate size to be eligible. Defaults to 0 for sensitivity scans.
InferenceNonParamBootstrap$approximate_bootstrap_distribution_beta_hat_T()
Creates the bootstrap distribution of the estimate for the treatment effect. The resampling unit is design-specific (rows, within-strata rows, matched pairs plus reservoir, or clusters); see the class-level section Design-specific validity caveats for the nonparametric bootstrap for the conservativeness and asymptotics of each concrete design.
Usage
InferenceNonParamBootstrap$approximate_bootstrap_distribution_beta_hat_T(
B = 501,
show_progress = TRUE,
debug = FALSE,
bootstrap_type = NULL
)Arguments
BNumber of bootstrap samples. The default is 501.
show_progressA flag indicating whether a progress bar should be displayed.
debugIf
TRUE, return a list with the distribution values and per-iteration diagnostics including error messages, warning messages, counts of each, and summary proportions for iterations with errors, warnings, and illegal (non-finite) values. Runs serially. DefaultFALSE.bootstrap_typeOptional bootstrap-resampling scheme. Legal public values are:
NULLUse the design's default row-resampling bootstrap. For ordinary non-blocking designs this is the usual subject-level resample-with-replacement bootstrap. For certain blocking designs,
NULLmaps to the same behavior as"within_blocks"."within_blocks"Only legal for blocking-style designs that support block-aware bootstrap resampling:
DesignFixedBlocking,DesignFixedOptimalBlocks,DesignSeqOneByOneSPBR, andDesignFixedBlockedCluster. Resamples observational units within each observed block/stratum. For blocked cluster designs this means resampling clusters within strata."resample_blocks"Only legal for the same blocking-style designs as
"within_blocks". Resamples entire observed blocks/strata with replacement rather than resampling units within each block.
Any non-
NULLvalue is rejected for designs outside that blocking family.
Returns
When debug = FALSE (default), a numeric vector of length B
containing the bootstrap estimates. When debug = TRUE, a list with: values,
errors (list of character vectors, one per iteration), warnings (list of
character vectors, one per iteration), num_errors, num_warnings,
prop_iterations_with_errors, prop_iterations_with_warnings, and
prop_illegal_values.
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval()
Computes a bootstrap-based two-sided p-value for the treatment effect. Validity is asymptotic and design-dependent; for most covariate-adaptive designs the p-value errs conservative. See the class-level section Design-specific validity caveats for the nonparametric bootstrap.
Usage
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval(
delta = 0,
B = 501,
type = NULL,
na.rm = FALSE,
show_progress = TRUE,
min_number_usable_samples = 5L
)Arguments
deltaNull hypothesis value. Default 0.
BNumber of bootstrap samples. Default 501.
typeBootstrap p-value type. Supported values are
"percentile"(default),"symmetric","studentized","bootstrap-t", and"bca"."percentile": shifts the bootstrap distribution to be centred atdeltaand counts the two-tail proportion (Hall 1992)."symmetric": uses \(|T^* - \bar{T}^*| \ge |t_{\rm obs} - \delta|\) for a symmetric one-sample test; recommended by Hall & Wilson (1991) when the null distribution may be skewed. This pooled-tail test is offered only as a p-value here, not as a confidence-intervaltypeincompute_bootstrap_confidence_interval: pooling both tails via \(|\cdot|\) improves testing power (Hall & Wilson's original use case), but inverting it unstudentized would add no value as an interval. The unstudentized pivot is not asymptotically pivotal, so the resulting interval would have the same first-order \(O(n^\{-1/2\})\) coverage error as"percentile"/"basic", while forcing symmetric bounds around a possibly skewed bootstrap distribution — strictly worse than"percentile"/"basic"for shape-adaptivity, and strictly worse than"symmetric-percentile-t"for accuracy, since studentizing (not the absolute-value pooling) is what buys the \(O(n^\{-1\})\) improvement. The CI-worthy symmetric variant is therefore"symmetric-percentile-t"(studentized pivot), not a plain"symmetric"CI type."studentized"/"bootstrap-t": pivots by the per-replicate standard error, giving O(n^{-1}) error versus O(n^{-1/2}) for the percentile method (Hall 1992; Davidson & MacKinnon 1999)."bca": bias-corrected and accelerated p-value via closed-form CI inversion using the jackknife acceleration and bias-correction constants; second-order accurate (Efron 1987; Efron & Tibshirani 1993).na.rmRemove non-finite bootstrap replicates. Default FALSE.
show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite bootstrap samples required after filtering. Default 5. Must be less than or equal to
B.
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval()
Computes a bootstrap-based confidence interval. Coverage is asymptotic and design-dependent; for most covariate-adaptive designs the interval errs conservative (over-coverage). See the class-level section Design-specific validity caveats for the nonparametric bootstrap.
Usage
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval(
alpha = 0.05,
B = 501,
type = NULL,
na.rm = TRUE,
show_progress = TRUE,
min_number_usable_samples = 5L
)Arguments
alphaThe confidence level 1 -
alpha. Default 0.05.BNumber of bootstrap samples. Default 501.
typeBootstrap CI type. Supported values are
"percentile","basic","studentized","bootstrap-t","symmetric-percentile-t","bca","prepivoted","double-bootstrap","calibrated", and"smoothed". There is no plain"symmetric"CI type (contrast with the"symmetric"p-value type incompute_bootstrap_two_sided_pval): inverting the unstudentized Hall & Wilson pooled-tail statistic would add no value as an interval, since it is not asymptotically pivotal and so has the same first-order \(O(n^\{-1/2\})\) coverage error as"percentile"/"basic", while forcing symmetric bounds around a possibly skewed bootstrap distribution — strictly worse than"percentile"/"basic"for shape-adaptivity, and strictly worse than"symmetric-percentile-t"for accuracy, since studentizing (not the absolute-value pooling) is what buys the \(O(n^\{-1\})\) improvement."symmetric-percentile-t"is the CI-worthy symmetric variant.na.rmRemove non-finite bootstrap replicates. Default TRUE. Non-finite replicates are always removed internally.
show_progressShow progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required after filtering. Default 5. Must be less than or equal to
B.