Skip to main content

BootstrapControl

Struct BootstrapControl 

Source
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: u64

Seed for the platform-independent SplitMix64 resampler.

§resamples: usize

Number of bootstrap replicates to retain.

§confidence_level: f64

Central interval mass, strictly between zero and one.

§max_work: u64

Maximum admitted sampled observations across all replicates.

Implementations§

Source§

impl BootstrapControl

Source

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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Copy for BootstrapControl

Source§

impl Debug for BootstrapControl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BootstrapControl

Source§

fn eq(&self, other: &BootstrapControl) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BootstrapControl

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.