Function basic_stochastics::matches_sigma_environment [] [src]

pub fn matches_sigma_environment(
    data: &Vec<f64>,
    sigma_room: f64,
    to_check: f64
) -> bool

Determines, whether the given value matches the given sigma environment of the given data's normal distribution. You can either provide a specific sigma environment or use one from the given constants. Please see https://en.wikipedia.org/wiki/Normal_distribution and sigma rooms for further information.

Examples

let data = vec![1.0, 2.0, 3.0, 4.0, 2.0];

assert_eq!(basic_stochastics::matches_sigma_environment(&data, basic_stochastics::ONE_SIGMA, 3.4), true);
assert_eq!(basic_stochastics::matches_sigma_environment(&data, basic_stochastics::ONE_SIGMA, 1.4), true);
assert_eq!(basic_stochastics::matches_sigma_environment(&data, basic_stochastics::ONE_SIGMA, 5.0), false);

assert_eq!(basic_stochastics::matches_sigma_environment(&data, basic_stochastics::TWO_SIGMA, 3.4), true);
assert_eq!(basic_stochastics::matches_sigma_environment(&data, basic_stochastics::TWO_SIGMA, 5.0), false);

assert_eq!(basic_stochastics::matches_sigma_environment(&data, 2.576, 3.4), true);