
Bayesian Bootstrap-capable Inference
Source:R/inference_all_abstract_bayesian_bootstrap.R
InferenceBayesianBootstrap.RdAbstract 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
Public methods
InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_pval_types()InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_ci_types()InferenceBayesianBootstrap$compute_estimate_with_bootstrap_weights()InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T()InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval()InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval()
+ inherited public methods from InferenceRandBootstrapCI
+ inherited public methods from InferenceRandBootstrap
+ inherited public methods from InferenceNonParamBootstrap
InferenceNonParamBootstrap$approximate_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$approximate_m_out_of_n_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$approximate_subsampling_distribution_beta_hat_T()InferenceNonParamBootstrap$compute_bootstrap_confidence_interval()InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_subsampling_confidence_interval()InferenceNonParamBootstrap$compute_subsampling_sensitivity()InferenceNonParamBootstrap$compute_subsampling_two_sided_pval()InferenceNonParamBootstrap$get_supported_bootstrap_ci_types()InferenceNonParamBootstrap$get_supported_bootstrap_pval_types()InferenceNonParamBootstrap$select_optimal_b_subsampling()InferenceNonParamBootstrap$select_optimal_m_out_of_n_bootstrap()+ 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()
InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_pval_types()
Returns the type values
compute_bayesian_bootstrap_two_sided_pval() accepts.
InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_ci_types()
Returns the type values
compute_bayesian_bootstrap_confidence_interval() accepts.
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_weightsNumeric 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_onlyIf
TRUE, compute only the point 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
BNumber of Bayesian-bootstrap replicates. 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.weighting_unit_typeOptional Bayesian-bootstrap weighting-unit scheme. Legal public values are:
NULLUse the design's default weighting-unit logic. For ordinary non-blocking designs this is the usual subject-level Bayesian 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 weighting:
DesignFixedBlocking,DesignFixedOptimalBlocks,DesignSeqOneByOneSPBR, andDesignFixedBlockedCluster. 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-
NULLvalue 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
deltaNull hypothesis value. Default 0.
BNumber of Bayesian-bootstrap replicates. Default 501.
typeType of Bayesian-bootstrap p-value. Supported values are
"percentile"(default),"symmetric","wald","studentized"/"bootstrap-t"(pivots by replicate SE fromcompute_estimate_with_bootstrap_weights(..., estimate_only = FALSE)), and"bca"(bias-corrected and accelerated via leave-one-unit-out Bayesian jackknife).na.rmIf
TRUE, discard non-finite bootstrap replicates before computing the p-value. Otherwise, any non-finite replicate returnsNA.show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite Bayesian-bootstrap replicates required after filtering. Default 5.
weighting_unit_typeOptional Bayesian-bootstrap weighting-unit scheme. See
InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T().
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
alphaSignificance level. Default 0.05.
BNumber of Bayesian-bootstrap replicates. Default 501.
typeType of Bayesian-bootstrap interval. Supported values are
"percentile"(default),"basic","wald","studentized"/"bootstrap-t"(pivots by replicate SE fromcompute_estimate_with_bootstrap_weights(..., estimate_only = FALSE)), and"bca"(bias-corrected and accelerated via leave-one-unit-out Bayesian jackknife).na.rmIf
TRUE, discard non-finite bootstrap replicates before constructing the interval.show_progressA flag indicating whether a progress bar should be displayed.
min_number_usable_samplesMinimum number of finite Bayesian-bootstrap replicates required after filtering. Default 5.
weighting_unit_typeOptional Bayesian-bootstrap weighting-unit scheme. See
InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T().