pub fn block_bootstrap_resample<R: Rng>(
data: &[f64],
block_size: usize,
rng: &mut R,
) -> Vec<f64>Expand description
Perform block bootstrap resampling on timing measurements.
Resamples measurements from a single class (fixed or random) while preserving autocorrelation structure. Blocks of consecutive measurements are sampled with replacement.
§Arguments
data- Slice of timing measurements for one classblock_size- Size of contiguous blocks to resamplerng- Random number generator
§Returns
A new vector of resampled measurements with the same length as input.
§Algorithm
- Divide data into overlapping blocks of size
block_size - Sample blocks with replacement until we have n samples
- Truncate to exactly n samples