pub struct Geometric { /* fields omitted */ }Implements the
Geometric
distribution
use statrs::distribution::{Geometric, Discrete};
use statrs::statistics::Mean;
let n = Geometric::new(0.3).unwrap();
assert_eq!(n.mean(), 1.0 / 0.3);
assert_eq!(n.pmf(1), 0.3);
assert_eq!(n.pmf(2), 0.21);
Constructs a new shifted geometric distribution with a probability
of p
Returns an error if p is not in (0, 1]
use statrs::distribution::Geometric;
let mut result = Geometric::new(0.5);
assert!(result.is_ok());
result = Geometric::new(0.0);
assert!(result.is_err());
Returns the probability p of the geometric
distribution
use statrs::distribution::Geometric;
let n = Geometric::new(0.5).unwrap();
assert_eq!(n.p(), 0.5);
Formats the value using the given formatter. Read more
Calculates the probability mass function for the geometric
distribution at x
Calculates the log probability mass function for the geometric
distribution at x
Generate a random value of T, using rng as the source of randomness.
Create an iterator that generates random values of T, using rng as
the source of randomness. Read more
Returns the entropy of the geometric distribution
(-(1 - p) * log_2(1 - p) - p * log_2(p)) / p
Returns the maximum value in the domain of the
geometric distribution representable by a 64-bit
integer
Returns the mean of the geometric distribution
Returns the median of the geometric distribution
Returns 1 if p is 1
Returns the minimum value in the domain of the
geometric distribution representable by a 64-bit
integer
Returns the mode of the geometric distribution
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Returns the skewness of the geometric distribution
Calculates the cumulative distribution function for the geometric
distribution at x
Returns the standard deviation of the geometric distribution
Returns the standard deviation of the geometric distribution
Returns NAN if p is 1
impl<T> Any for T where
T: 'static + ?Sized, [src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>, [src]
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.