pub trait Distribution<T: Float> {
// Provided methods
fn mean(&self) -> Option<T> { ... }
fn variance(&self) -> Option<T> { ... }
fn std_dev(&self) -> Option<T> { ... }
fn entropy(&self) -> Option<T> { ... }
fn skewness(&self) -> Option<T> { ... }
}
Provided Methods§
Sourcefn mean(&self) -> Option<T>
fn mean(&self) -> Option<T>
Returns the mean, if it exists.
§Examples
use statrs::statistics::Distribution;
use statrs::distribution::Uniform;
let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!(0.5, n.mean().unwrap());
Sourcefn variance(&self) -> Option<T>
fn variance(&self) -> Option<T>
Returns the variance, if it exists.
§Examples
use statrs::statistics::Distribution;
use statrs::distribution::Uniform;
let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!(1.0 / 12.0, n.variance().unwrap());
Sourcefn std_dev(&self) -> Option<T>
fn std_dev(&self) -> Option<T>
Returns the standard deviation, if it exists.
§Examples
use statrs::statistics::Distribution;
use statrs::distribution::Uniform;
let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!((1f64 / 12f64).sqrt(), n.std_dev().unwrap());