Struct statrs::distribution::DiscreteUniform [−][src]
pub struct DiscreteUniform { /* fields omitted */ }
Implements the Discrete Uniform distribution
Examples
use statrs::distribution::{DiscreteUniform, Discrete}; use statrs::statistics::Mean; let n = DiscreteUniform::new(0, 5).unwrap(); assert_eq!(n.mean(), 2.5); assert_eq!(n.pmf(3), 1.0 / 6.0);
Implementations
impl DiscreteUniform
[src]
impl DiscreteUniform
[src]pub fn new(min: i64, max: i64) -> Result<DiscreteUniform>
[src]
Constructs a new discrete uniform distribution with a minimum value
of min
and a maximum value of max
.
Errors
Returns an error if max < min
Examples
use statrs::distribution::DiscreteUniform; let mut result = DiscreteUniform::new(0, 5); assert!(result.is_ok()); result = DiscreteUniform::new(5, 0); assert!(result.is_err());
Trait Implementations
impl Clone for DiscreteUniform
[src]
impl Clone for DiscreteUniform
[src]fn clone(&self) -> DiscreteUniform
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Discrete<i64, f64> for DiscreteUniform
[src]
impl Discrete<i64, f64> for DiscreteUniform
[src]impl Distribution<f64> for DiscreteUniform
[src]
impl Distribution<f64> for DiscreteUniform
[src]impl Entropy<f64> for DiscreteUniform
[src]
impl Entropy<f64> for DiscreteUniform
[src]impl Max<i64> for DiscreteUniform
[src]
impl Max<i64> for DiscreteUniform
[src]impl Mean<f64> for DiscreteUniform
[src]
impl Mean<f64> for DiscreteUniform
[src]impl Median<f64> for DiscreteUniform
[src]
impl Median<f64> for DiscreteUniform
[src]impl Min<i64> for DiscreteUniform
[src]
impl Min<i64> for DiscreteUniform
[src]impl Mode<i64> for DiscreteUniform
[src]
impl Mode<i64> for DiscreteUniform
[src]impl PartialEq<DiscreteUniform> for DiscreteUniform
[src]
impl PartialEq<DiscreteUniform> for DiscreteUniform
[src]fn eq(&self, other: &DiscreteUniform) -> bool
[src]
fn ne(&self, other: &DiscreteUniform) -> bool
[src]
impl Skewness<f64> for DiscreteUniform
[src]
impl Skewness<f64> for DiscreteUniform
[src]impl Univariate<i64, f64> for DiscreteUniform
[src]
impl Univariate<i64, f64> for DiscreteUniform
[src]impl Variance<f64> for DiscreteUniform
[src]
impl Variance<f64> for DiscreteUniform
[src]