Skip to main content

block_bootstrap_resample

Function block_bootstrap_resample 

Source
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 class
  • block_size - Size of contiguous blocks to resample
  • rng - Random number generator

§Returns

A new vector of resampled measurements with the same length as input.

§Algorithm

  1. Divide data into overlapping blocks of size block_size
  2. Sample blocks with replacement until we have n samples
  3. Truncate to exactly n samples