Skip to contents

Intermediate 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.

Methods

+ inherited public methods from InferenceAsympLik
+ inherited public methods from InferenceMLEorKMSummaryTable
+ inherited public methods from InferenceAsymp
+ inherited public methods from InferenceJackknife
+ inherited public methods from InferenceBayesianBootstrap
+ 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


InferenceParamBootstrap$get_last_param_bootstrap_diagnostics()

Returns diagnostics from the most recent parametric-bootstrap LR run.

Usage

InferenceParamBootstrap$get_last_param_bootstrap_diagnostics()

Returns

A list of diagnostics, or NULL if no parametric-bootstrap LR run has been executed.


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

delta

Null treatment effect. Default 0.

B

Number of bootstrap replicates. Default 199.

show_progress

Logical; show a progress bar. Default FALSE.

min_number_usable_samples

Minimum number of usable bootstrap replicates required to return a finite p-value. Default 5L.

max_attempts_per_replicate

Maximum number of simulation/refit retries per bootstrap replicate. Default 2L.

Returns

A scalar p-value, or NA_real_ if the computation fails.


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

alpha

Significance level. Default 0.05.

B

Bootstrap replicates per p-value evaluation. Default 199.

show_progress

Logical; show a progress bar. Default FALSE.

min_number_usable_samples

Minimum number of usable bootstrap replicates required within each p-value evaluation. Default 5L.

max_attempts_per_replicate

Maximum number of simulation/refit retries per bootstrap replicate. Default 2L.

root_tolerance

Effect-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_iterations

Maximum number of bisection iterations per bound during interval inversion. Use 0L to return the first finite outer bracket. Default 8L.

Returns

Named two-element numeric vector with the confidence-interval bounds.


InferenceParamBootstrap$get_last_param_bootstrap_estimate_diagnostics()

Returns diagnostics from the most recent compute_param_bootstrap_estimate() run.

Usage

InferenceParamBootstrap$get_last_param_bootstrap_estimate_diagnostics()

Returns

A list of diagnostics, or NULL if no parametric-bootstrap estimate bias correction has been 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

B

Number of bootstrap replicates. Default 199.

show_progress

Logical; show a progress bar. Default FALSE.

min_number_usable_samples

Minimum number of usable bootstrap replicates required to return a finite estimate. Default 5L.

max_attempts_per_replicate

Maximum number of simulation/refit retries per bootstrap replicate. Default 2L.

Returns

A scalar bias-corrected estimate, or NA_real_ if the computation fails.


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

alpha

Significance level. Default 0.05.

B

Number of bootstrap replicates. Default 199.

show_progress

Logical; show a progress bar. Default FALSE.

min_number_usable_samples

Minimum number of usable bootstrap replicates required to return a finite interval. Default 5L.

max_attempts_per_replicate

Maximum number of simulation/refit retries per bootstrap replicate. Default 2L.

Returns

Named two-element numeric vector with the confidence-interval bounds.


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

delta

Null value of the coefficient of interest.

B

Number of bootstrap replicates. Default 199.

show_progress

Logical; show a progress bar. Default FALSE.

min_number_usable_samples

Minimum number of usable bootstrap replicates required to return a finite p-value. Default 5L.

max_attempts_per_replicate

Maximum 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


InferenceParamBootstrap$clone()

The objects of this class are cloneable with this method.

Usage

InferenceParamBootstrap$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.