Internal helper: resamples weights, finds the p_value that achieves the
resampled mean weight via optim_search_p_value, then extracts
consumption and (optionally) the predicted final weight.
Extracted to eliminate code duplication between the sequential and parallel
execution paths of bootstrap_p_values.
bootstrap_single_iteration(
final_weights,
n_sample,
simulation_function,
processed_simulation_data,
oxycal,
store_predicted_weights,
upper_p = 1
)Named list with fields p_estimate, consumption_estimate,
predicted_weight, mean_fin, and success (logical).
Observed final weights vector
Sample size for bootstrap resampling
Closure accepting a p_value and returning the
predicted final weight; used by optim_search_p_value
Processed simulation data list
Oxycalorific coefficient (J/g O2)
Logical; retrieve the predicted final weight?
Upper bound for p_value search, default 5.0