
Parametric-Bootstrap-Capable Likelihood Inference
Source:R/inference_all_abstract_param_boot.R
InferenceParamBootstrap.RdIntermediate abstract base for the subset of likelihood-backed inference families that are plausible targets for parametric null-bootstrap likelihood-ratio calibration.
This class sits between InferenceAsympLik and
InferenceAsympLikStdModCache in the hierarchy. Families with highly
bespoke partial-likelihood, quadrature, frailty, copula, or custom
combined-likelihood geometry remain direct children of
InferenceAsympLik and do not pass through here.
The only operational user-facing parametric-bootstrap LR methods on this
surface are
compute_lik_ratio_bootstrap_two_sided_pval(...) and
compute_lik_ratio_bootstrap_confidence_interval(...). Diagnostic
accessors such as get_last_param_bootstrap_diagnostics() are
supplementary and not alternative execution entry points.
Parametric-bootstrap LR calibration is available only for concrete classes
that inherit from InferenceParamBootstrap and whose private method
supports_lik_ratio_param_bootstrap() returns TRUE. Families
that are intentionally unsupported are kept off this branch entirely.
Super classes
Inference -> InferenceRand -> InferenceRandCI -> InferenceNonParamBootstrap -> InferenceRandBootstrap -> InferenceRandBootstrapCI -> InferenceBayesianBootstrap -> InferenceJackknife -> InferenceAsymp -> InferenceMLEorKMSummaryTable -> InferenceAsympLik -> InferenceParamBootstrap
Methods
Public methods
InferenceParamBootstrap$get_last_param_bootstrap_diagnostics()InferenceParamBootstrap$compute_lik_ratio_bootstrap_two_sided_pval()InferenceParamBootstrap$compute_lik_ratio_bootstrap_confidence_interval()InferenceParamBootstrap$get_last_param_bootstrap_estimate_diagnostics()InferenceParamBootstrap$compute_param_bootstrap_confidence_interval()
+ inherited public methods from InferenceAsympLik
InferenceAsympLik$compute_asymp_confidence_interval()InferenceAsympLik$compute_asymp_two_sided_pval()InferenceAsympLik$compute_gradient_confidence_interval()InferenceAsympLik$compute_gradient_two_sided_pval()InferenceAsympLik$compute_lik_ratio_bartlett_approx_confidence_interval()InferenceAsympLik$compute_lik_ratio_bartlett_approx_two_sided_pval()InferenceAsympLik$compute_lik_ratio_bartlett_confidence_interval()InferenceAsympLik$compute_lik_ratio_bartlett_exact_confidence_interval()InferenceAsympLik$compute_lik_ratio_bartlett_exact_two_sided_pval()InferenceAsympLik$compute_lik_ratio_bartlett_two_sided_pval()InferenceAsympLik$compute_lik_ratio_confidence_interval()InferenceAsympLik$compute_lik_ratio_two_sided_pval()InferenceAsympLik$compute_score_confidence_interval()InferenceAsympLik$compute_score_two_sided_pval()InferenceAsympLik$get_information_preference()InferenceAsympLik$get_information_source_used()InferenceAsympLik$get_supported_information_preferences()InferenceAsympLik$get_supported_testing_types()InferenceAsympLik$get_testing_type()InferenceAsympLik$set_information_preference()InferenceAsympLik$set_testing_type()+ inherited public methods from InferenceMLEorKMSummaryTable
+ inherited public methods from InferenceAsymp
+ inherited public methods from InferenceJackknife
InferenceJackknife$approximate_jackknife_distribution_beta_hat_T()InferenceJackknife$compute_jackknife_bias_estimate()InferenceJackknife$compute_jackknife_estimate()InferenceJackknife$compute_jackknife_std_error()InferenceJackknife$compute_jackknife_wald_confidence_interval()InferenceJackknife$compute_jackknife_wald_two_sided_pval()+ inherited public methods from InferenceBayesianBootstrap
InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T()InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval()InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval()InferenceBayesianBootstrap$compute_estimate_with_bootstrap_weights()InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_ci_types()InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_pval_types()+ 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_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()
InferenceParamBootstrap$get_last_param_bootstrap_diagnostics()
Returns diagnostics from the most recent parametric-bootstrap LR run.
InferenceParamBootstrap$compute_lik_ratio_bootstrap_two_sided_pval()
Bootstrap-calibrated likelihood-ratio two-sided p-value.
Fits the null model at delta, simulates B datasets from
that fitted null, refits unrestricted and null models on each, and
returns the empirical tail probability of the observed LR statistic.
This is the primary user-facing entry point for bootstrap-calibrated
likelihood-ratio p-values.
This method is available only for classes whose private
supports_lik_ratio_param_bootstrap() method returns TRUE.
For unsupported classes it errors immediately rather than silently
falling back to another procedure.
The standard user-facing arguments are delta = 0,
B = 199, and show_progress = FALSE. The remaining
arguments control replicate-quality thresholds and retry behavior.
Runtime cost is roughly one unrestricted fit plus B simulated
unrestricted/null refit pairs, so this is typically much more
expensive than the asymptotic LR p-value.
Usage
InferenceParamBootstrap$compute_lik_ratio_bootstrap_two_sided_pval(
delta = 0,
B = 199,
show_progress = FALSE,
min_number_usable_samples = 5L,
max_attempts_per_replicate = 2L
)Arguments
deltaNull treatment effect. Default 0.
BNumber of bootstrap replicates. Default 199.
show_progressLogical; show a progress bar. Default
FALSE.min_number_usable_samplesMinimum number of usable bootstrap replicates required to return a finite p-value. Default
5L.max_attempts_per_replicateMaximum number of simulation/refit retries per bootstrap replicate. Default
2L.
InferenceParamBootstrap$compute_lik_ratio_bootstrap_confidence_interval()
Bootstrap-calibrated likelihood-ratio confidence interval.
Inverts compute_lik_ratio_bootstrap_two_sided_pval via a
bracket-and-bisect search seeded with the Wald interval. Each p-value
evaluation costs B bootstrap refits, so this method is
substantially more expensive than the p-value alone.
This is the primary user-facing entry point for bootstrap-calibrated
likelihood-ratio confidence intervals.
This method is available only for classes whose private
supports_lik_ratio_param_bootstrap_confidence_interval() method
returns TRUE.
The standard user-facing arguments are B = 199 and
show_progress = FALSE. Runtime cost is high because each
confidence-interval bound requires repeated bootstrap p-value
evaluations.
Usage
InferenceParamBootstrap$compute_lik_ratio_bootstrap_confidence_interval(
alpha = 0.05,
B = 199,
show_progress = FALSE,
min_number_usable_samples = 5L,
max_attempts_per_replicate = 2L,
root_tolerance = NULL,
max_root_iterations = 8L
)Arguments
alphaSignificance level. Default 0.05.
BBootstrap replicates per p-value evaluation. Default 199.
show_progressLogical; show a progress bar. Default
FALSE.min_number_usable_samplesMinimum number of usable bootstrap replicates required within each p-value evaluation. Default
5L.max_attempts_per_replicateMaximum number of simulation/refit retries per bootstrap replicate. Default
2L.root_toleranceEffect-scale tolerance for the inversion root. If
NULL, a tolerance proportional to the Wald standard error is used. The bootstrap p-value being inverted is Monte Carlo-discrete, so solving to machine precision is not meaningful.max_root_iterationsMaximum number of bisection iterations per bound during interval inversion. Use
0Lto return the first finite outer bracket. Default8L.
InferenceParamBootstrap$get_last_param_bootstrap_estimate_diagnostics()
Returns diagnostics from the most recent
compute_param_bootstrap_estimate() run.
InferenceParamBootstrap$compute_param_bootstrap_estimate()
Parametric-bootstrap bias-corrected point estimate.
Simulates B datasets from the model at the unrestricted
fit (not a null-restricted fit, unlike the LR-bootstrap methods on
this class), refits each unrestricted, and returns
2 * theta_hat - mean(theta_hat_star) – the standard
single-level parametric-bootstrap bias correction (Efron & Tibshirani),
the Monte-Carlo analog of an analytic Cox-Snell (1968) first-order bias
correction. Reuses the same simulate_under_lik_null() contract
every supports_lik_ratio_param_bootstrap() == TRUE family already
implements, anchoring the simulation at the unrestricted fit instead of
a null-restricted one.
This method is available only for classes whose private
supports_param_bootstrap_estimate() method returns TRUE
(by default, this delegates to supports_lik_ratio_param_bootstrap()).
Usage
InferenceParamBootstrap$compute_param_bootstrap_estimate(
B = 199,
show_progress = FALSE,
min_number_usable_samples = 5L,
max_attempts_per_replicate = 2L
)Arguments
BNumber of bootstrap replicates. Default 199.
show_progressLogical; show a progress bar. Default
FALSE.min_number_usable_samplesMinimum number of usable bootstrap replicates required to return a finite estimate. Default
5L.max_attempts_per_replicateMaximum number of simulation/refit retries per bootstrap replicate. Default
2L.
InferenceParamBootstrap$compute_param_bootstrap_confidence_interval()
Parametric-bootstrap "basic" (reflected) confidence interval.
Uses the same kind of simulate-at-full_fit replicates as
compute_param_bootstrap_estimate() – run once, not
re-simulated per candidate null – and reflects their empirical
quantiles around the raw estimate:
CI = [2*theta_hat - q_(1-alpha/2)(theta_star), 2*theta_hat - q_(alpha/2)(theta_star)].
This is the standard "basic" bootstrap interval (Efron & Tibshirani):
the bias-aware companion to compute_param_bootstrap_estimate()
– unlike a naive percentile interval, it reflects around the same
point the estimate's own bias correction targets.
Unlike compute_lik_ratio_bootstrap_confidence_interval(), which
must re-simulate B fresh replicates at every candidate null
value visited during bisection (because that method's replicates are
anchored at a null-restricted fit that changes with the candidate
value), this method's replicates are anchored at the single
unrestricted fit and therefore do not need to be regenerated per
alpha or inverted against any particular null – one batch of
B replicates supports the whole interval.
This method is available only for classes whose private
supports_param_bootstrap_estimate() method returns TRUE.
Usage
InferenceParamBootstrap$compute_param_bootstrap_confidence_interval(
alpha = 0.05,
B = 199,
show_progress = FALSE,
min_number_usable_samples = 5L,
max_attempts_per_replicate = 2L
)Arguments
alphaSignificance level. Default 0.05.
BNumber of bootstrap replicates. Default 199.
show_progressLogical; show a progress bar. Default
FALSE.min_number_usable_samplesMinimum number of usable bootstrap replicates required to return a finite interval. Default
5L.max_attempts_per_replicateMaximum number of simulation/refit retries per bootstrap replicate. Default
2L.
InferenceParamBootstrap$compute_param_bootstrap_pval()
Parametric-bootstrap two-sided p-value for H0: theta = delta,
obtained by inverting the same "basic" reflected-quantile construction
as compute_param_bootstrap_confidence_interval() rather than by
simulating fresh replicates under each candidate delta (contrast
compute_lik_ratio_bootstrap_two_sided_pval(), which does
resimulate per delta because its replicates are anchored at a
null-restricted fit that changes with delta).
Reflects delta through the raw estimate, t = 2*theta_hat - delta,
and reports twice the smaller empirical tail of the replicate
distribution beyond t (with the same +1 continuity correction
used by compute_lik_ratio_bootstrap_two_sided_pval()). Because
the replicate batch does not depend on delta, this is a direct
lookup against one batch of B replicates – valid for any
delta with no additional simulation.
As with the confidence interval, this test implicitly assumes the
shape of theta_hat's sampling distribution near delta resembles
its shape at the unrestricted fit – an approximation that degrades
the further delta is from the observed estimate, and is why
this p-value should be treated as a cheap default rather than a
replacement for compute_lik_ratio_bootstrap_two_sided_pval()
when accuracy near a specific null matters.
Usage
InferenceParamBootstrap$compute_param_bootstrap_pval(
delta,
B = 199,
show_progress = FALSE,
min_number_usable_samples = 5L,
max_attempts_per_replicate = 2L
)Arguments
deltaNull value of the coefficient of interest.
BNumber of bootstrap replicates. Default 199.
show_progressLogical; show a progress bar. Default
FALSE.min_number_usable_samplesMinimum number of usable bootstrap replicates required to return a finite p-value. Default
5L.max_attempts_per_replicateMaximum number of simulation/refit retries per bootstrap replicate. Default
2L.
Returns
A scalar p-value, or NA_real_ if the computation fails.
Shared replicate-running core for anything built on B simulated null
datasets via simulate_under_lik_null() (currently:
compute_lik_ratio_bootstrap_two_sided_pval() and, via
InferenceExtBartlettApprox, get_bartlett_factor_approx()). Handles
seeding, multi-core parallelism, the reusable-worker-state optimization,
and deterministic-mode thread budgeting uniformly, so every caller gets
the same performance characteristics for free. Returns a list with
$results (one per-replicate result object per B, each carrying at least
$lr), $used_worker_path, and $used_deterministic_mode.
Callers are responsible for setting private$active_resampling_operation themselves (not done here, to avoid a nested caller clobbering an already-active outer flag via a premature on.exit reset). Simulate a bootstrap dataset under the fitted null likelihood and return a minimal spec list for refitting.
Must be overridden by families that set supports_lik_ratio_param_bootstrap() to TRUE. The returned list must contain at least: - full_fit: unrestricted fit on the simulated data - fit_null: function(delta, start) returning a constrained fit - neg_loglik: function(fit) returning the neg-log-likelihood