Learn R Programming

fb4package (version 2.0.0)

bootstrap_p_values: Bootstrap estimation of p_values with optional parallel processing

Description

Estimates population p_value and consumption using bootstrap resampling of final weights. Parallel execution is supported via the future / furrr ecosystem when parallel = TRUE.

Each iteration delegates to bootstrap_single_iteration so that the sequential and parallel code paths share a single implementation.

Usage

bootstrap_p_values(
  processed_simulation_data,
  n_bootstrap = 1000,
  oxycal = 13560,
  sample_size = NULL,
  parallel = FALSE,
  n_cores = NULL,
  upper_p = 1,
  verbose = FALSE,
  store_predicted_weights = TRUE
)

Value

Named list with:

p_values

Valid p_value estimates (NAs removed)

consumption_estimates

Valid consumption estimates

predicted_weights

Valid predicted weights, or NULL

success_rate, n_bootstrap, successful_iterations

Diagnostics

parallel_used, n_cores_used

Execution metadata

Arguments

processed_simulation_data

Complete processed simulation data (must contain simulation_settings$initial_weight and simulation_settings$observed_weights)

n_bootstrap

Number of bootstrap iterations, default 1000

oxycal

Oxycalorific coefficient (J/g O2), default 13560

sample_size

Sample size per iteration; NULL = same as data

parallel

Logical; use parallel processing? default FALSE

n_cores

Number of cores for parallel processing (NULL = auto-detect via future::availableCores())

verbose

Logical; show progress messages? default FALSE

store_predicted_weights

Logical; store predicted final weights? default TRUE

See Also

bootstrap_single_iteration, fit_fb4_bootstrap