3 releases
new 0.1.2 | Nov 7, 2024 |
---|---|
0.1.1 | Nov 7, 2024 |
0.1.0 | Nov 6, 2024 |
#523 in Rust patterns
63 downloads per month
Used in probabilistic_bisector
15KB
221 lines
confidence
A simple crate for dealing with confidence levels, significance levels and confidence intervals.
Significance Levels
The significance level describes the evidence present in a sample under test which allows for rejection of the null hypothesis (the state when two outcomes or possibilities are the same). In a measurement model the null hypothesis under test is typically whether a given reading is indistinguishable from another, or whether it is indistinguishable from the system response at zero stimulus (the minimum detectable value).
use confi::SignificanceLevel;
let from_fraction = SignificanceLevel::fractional(0.1).unwrap();
let from_percentage = SignificanceLevel::percentage(10.0).unwrap();
assert_eq!(from_fraction, from_percentage);
Confidence Levels
The confidence level describes the probability of obtaining the same result in repeated data collection processes.
use confi::ConfidenceLevel;
let from_fraction = ConfidenceLevel::fractional(0.1).unwrap();
let from_percentage = ConfidenceLevel::percentage(10.0).unwrap();
assert_eq!(from_fraction, from_percentage);
Confidence intervals
A confidence interval is a range of results which can be deemed to contain a measured value to a given confidence level.
use confi::{ConfidenceLevel, ConfidenceInterval, Confidence};
let from_fraction = ConfidenceLevel::fractional(0.1).unwrap();
let interval = ConfidenceInterval::new(1.0..=3.0, from_fraction);
assert!(interval.contains(2.0));
Dependencies
~7.5MB
~146K SLoC