pub struct BootstrapControl {
pub seed: u64,
pub resamples: usize,
pub confidence_level: f64,
pub max_work: u64,
}Expand description
Controls a deterministic bootstrap of the candidate-minus-baseline mean.
One work unit is one sampled observation. max_work therefore bounds the
exact resampling cost before allocation or sampling begins.
Fields§
§seed: u64Seed for the platform-independent SplitMix64 resampler.
resamples: usizeNumber of bootstrap replicates to retain.
confidence_level: f64Central interval mass, strictly between zero and one.
max_work: u64Maximum admitted sampled observations across all replicates.
Implementations§
Source§impl BootstrapControl
impl BootstrapControl
Sourcepub fn new(
seed: u64,
resamples: usize,
confidence_level: f64,
max_work: u64,
) -> StatsResult<Self>
pub fn new( seed: u64, resamples: usize, confidence_level: f64, max_work: u64, ) -> StatsResult<Self>
Builds and validates a bootstrap control.
Examples found in repository?
examples/robust_benchmark_statistics.rs (line 8)
5fn main() {
6 let baseline = [101.0, 99.0, 100.0, 102.0, 98.0];
7 let candidate = [91.0, 89.0, 90.0, 92.0, 88.0];
8 let control = BootstrapControl::new(19, 2_000, 0.95, 20_000).unwrap();
9 let interval = bootstrap_mean_difference_interval(&baseline, &candidate, control).unwrap();
10
11 println!(
12 "baseline MAD: {:.1}",
13 median_absolute_deviation(&baseline).unwrap()
14 );
15 println!(
16 "candidate-minus-baseline mean: {:.1}",
17 interval.point_effect
18 );
19 println!(
20 "95% interval: [{:.1}, {:.1}]",
21 interval.lower, interval.upper
22 );
23 println!("seed: {}, resamples: {}", interval.seed, interval.resamples);
24}Trait Implementations§
Source§impl Clone for BootstrapControl
impl Clone for BootstrapControl
Source§fn clone(&self) -> BootstrapControl
fn clone(&self) -> BootstrapControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BootstrapControl
Source§impl Debug for BootstrapControl
impl Debug for BootstrapControl
Source§impl PartialEq for BootstrapControl
impl PartialEq for BootstrapControl
impl StructuralPartialEq for BootstrapControl
Auto Trait Implementations§
impl Freeze for BootstrapControl
impl RefUnwindSafe for BootstrapControl
impl Send for BootstrapControl
impl Sync for BootstrapControl
impl Unpin for BootstrapControl
impl UnsafeUnpin for BootstrapControl
impl UnwindSafe for BootstrapControl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more