Skip to contents

Abstract class for Dirichlet-weight Bayesian bootstrap inference layered on top of the existing nonparametric bootstrap infrastructure.

Super classes

Inference -> InferenceRand -> InferenceRandCI -> InferenceNonParamBootstrap -> InferenceRandBootstrap -> InferenceRandBootstrapCI -> InferenceBayesianBootstrap

Methods

+ inherited public methods from InferenceRandBootstrapCI
+ inherited public methods from InferenceRandBootstrap
+ inherited public methods from InferenceNonParamBootstrap
+ 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


InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_pval_types()

Returns the type values compute_bayesian_bootstrap_two_sided_pval() accepts.

Usage

InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_pval_types()


InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_ci_types()

Returns the type values compute_bayesian_bootstrap_confidence_interval() accepts.

Usage

InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_ci_types()


InferenceBayesianBootstrap$compute_estimate_with_bootstrap_weights()

Recomputes the treatment estimate under Bayesian-bootstrap subject-, block-, cluster-, or matched-set weights.

This is an abstract hook implemented by concrete inference families that support weighted re-estimation.

Usage

InferenceBayesianBootstrap$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Numeric Bayesian-bootstrap weights at the design's exchangeable resampling unit. For ordinary designs these are subject-level weights. For blocking, clustering, or matching designs these may instead be block-, cluster-, pair-, or matched-set-level weights, depending on weighting_unit_type.

estimate_only

If TRUE, compute only the point estimate for the weighted replicate.

Returns

A numeric treatment-effect estimate for the weighted replicate.


InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T()

Creates the Bayesian-bootstrap distribution of the treatment estimate using Dirichlet weights.

Usage

InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T(
  B = 501,
  show_progress = TRUE,
  debug = FALSE,
  weighting_unit_type = NULL
)

Arguments

B

Number of Bayesian-bootstrap replicates. The default is 501.

show_progress

A flag indicating whether a progress bar should be displayed.

debug

If 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. Default FALSE.

weighting_unit_type

Optional Bayesian-bootstrap weighting-unit scheme. Legal public values are:

NULL

Use the design's default weighting-unit logic. For ordinary non-blocking designs this is the usual subject-level Bayesian bootstrap. For certain blocking designs, NULL maps to the same behavior as "within_blocks".

"within_blocks"

Only legal for blocking-style designs that support block-aware weighting: DesignFixedBlocking, DesignFixedOptimalBlocks, DesignSeqOneByOneSPBR, and DesignFixedBlockedCluster. Draws Dirichlet weights on observational units within each observed block/stratum. For blocked cluster designs this means cluster-within-stratum weights.

"resample_blocks"

Only legal for the same blocking-style designs as "within_blocks". Draws Dirichlet weights on whole observed blocks/strata rather than on units within each block.

Any non-NULL value is rejected for designs outside that blocking family.

Returns

When debug = FALSE (default), a numeric vector of length B containing the Bayesian-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.


InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval()

Computes a Bayesian-bootstrap-based two-sided p-value for the treatment effect.

Usage

InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval(
  delta = 0,
  B = 501,
  type = NULL,
  na.rm = FALSE,
  show_progress = TRUE,
  min_number_usable_samples = 5L,
  weighting_unit_type = NULL
)

Arguments

delta

Null hypothesis value. Default 0.

B

Number of Bayesian-bootstrap replicates. Default 501.

type

Type of Bayesian-bootstrap p-value. Supported values are "percentile" (default), "symmetric", "wald", "studentized" / "bootstrap-t" (pivots by replicate SE from compute_estimate_with_bootstrap_weights(..., estimate_only = FALSE)), and "bca" (bias-corrected and accelerated via leave-one-unit-out Bayesian jackknife).

na.rm

If TRUE, discard non-finite bootstrap replicates before computing the p-value. Otherwise, any non-finite replicate returns NA.

show_progress

A flag indicating whether a progress bar should be displayed.

min_number_usable_samples

Minimum number of finite Bayesian-bootstrap replicates required after filtering. Default 5.

weighting_unit_type

Optional Bayesian-bootstrap weighting-unit scheme. See InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T().

Returns

A numeric two-sided p-value, or NA_real_ if too few usable replicates remain or the estimate is non-finite.


InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval()

Computes a Bayesian-bootstrap confidence interval for the treatment effect.

Usage

InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval(
  alpha = 0.05,
  B = 501,
  type = NULL,
  na.rm = TRUE,
  show_progress = TRUE,
  min_number_usable_samples = 5L,
  weighting_unit_type = NULL
)

Arguments

alpha

Significance level. Default 0.05.

B

Number of Bayesian-bootstrap replicates. Default 501.

type

Type of Bayesian-bootstrap interval. Supported values are "percentile" (default), "basic", "wald", "studentized" / "bootstrap-t" (pivots by replicate SE from compute_estimate_with_bootstrap_weights(..., estimate_only = FALSE)), and "bca" (bias-corrected and accelerated via leave-one-unit-out Bayesian jackknife).

na.rm

If TRUE, discard non-finite bootstrap replicates before constructing the interval.

show_progress

A flag indicating whether a progress bar should be displayed.

min_number_usable_samples

Minimum number of finite Bayesian-bootstrap replicates required after filtering. Default 5.

weighting_unit_type

Optional Bayesian-bootstrap weighting-unit scheme. See InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T().

Returns

A length-2 numeric confidence interval. Returns c(NA_real_, NA_real_) when the estimate is non-finite or too few usable replicates remain.


InferenceBayesianBootstrap$clone()

The objects of this class are cloneable with this method.

Usage

InferenceBayesianBootstrap$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.