[−][src]Struct rv::dist::Geometric
Geometric distribution over x in {0, 1, 2, 3, ... }.
Example
use rv::prelude::*; // Create Geometric(p=0.5) let geom = Geometric::new(0.5).unwrap(); // Draw Samples let mut rng = rand::thread_rng(); let xs: Vec<u32> = geom.sample(100, &mut rng); assert_eq!(xs.len(), 100)
Methods
impl Geometric
[src]
impl Geometric
[src]
pub fn new(p: f64) -> Result<Self, GeometricError>
[src]
Create a new geometric distribution
pub fn new_unchecked(p: f64) -> Self
[src]
Creates a new Geometric without checking whether the parameter is valid.
pub fn p(&self) -> f64
[src]
Get the p parameter
Trait Implementations
impl<X> Cdf<X> for Geometric where
X: Unsigned + Integer + FromPrimitive + ToPrimitive + Saturating + Bounded,
[src]
X: Unsigned + Integer + FromPrimitive + ToPrimitive + Saturating + Bounded,
impl Clone for Geometric
[src]
impl Debug for Geometric
[src]
impl Default for Geometric
[src]
impl<X> DiscreteDistr<X> for Geometric where
X: Unsigned + Integer + FromPrimitive + ToPrimitive + Saturating + Bounded,
[src]
X: Unsigned + Integer + FromPrimitive + ToPrimitive + Saturating + Bounded,
impl Display for Geometric
[src]
impl Entropy for Geometric
[src]
impl<'_> From<&'_ Geometric> for String
[src]
impl Kurtosis for Geometric
[src]
impl Mean<f64> for Geometric
[src]
impl PartialEq<Geometric> for Geometric
[src]
impl PartialOrd<Geometric> for Geometric
[src]
fn partial_cmp(&self, other: &Geometric) -> Option<Ordering>
[src]
fn lt(&self, other: &Geometric) -> bool
[src]
fn le(&self, other: &Geometric) -> bool
[src]
fn gt(&self, other: &Geometric) -> bool
[src]
fn ge(&self, other: &Geometric) -> bool
[src]
impl<X> Rv<X> for Geometric where
X: Unsigned + Integer + FromPrimitive + ToPrimitive + Saturating + Bounded,
[src]
X: Unsigned + Integer + FromPrimitive + ToPrimitive + Saturating + Bounded,
fn ln_f(&self, k: &X) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> X
[src]
fn f(&self, x: &X) -> f64
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
impl Skewness for Geometric
[src]
impl StructuralPartialEq for Geometric
[src]
impl<X> Support<X> for Geometric where
X: Unsigned + Integer,
[src]
X: Unsigned + Integer,
impl Variance<f64> for Geometric
[src]
Auto Trait Implementations
impl RefUnwindSafe for Geometric
impl Send for Geometric
impl Sync for Geometric
impl Unpin for Geometric
impl UnwindSafe for Geometric
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Fx, X> Cdf<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Cdf<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Cdf<X>,
impl<Fx, X> DiscreteDistr<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: DiscreteDistr<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: DiscreteDistr<X>,
impl<Fx> Entropy for Fx where
Fx: Deref,
<Fx as Deref>::Target: Entropy,
[src]
Fx: Deref,
<Fx as Deref>::Target: Entropy,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Fx> Kurtosis for Fx where
Fx: Deref,
<Fx as Deref>::Target: Kurtosis,
[src]
Fx: Deref,
<Fx as Deref>::Target: Kurtosis,
impl<Fx, X> Mean<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Mean<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Mean<X>,
impl<Fx, X> Rv<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Rv<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Rv<X>,
fn ln_f(&Self, &X) -> f64
[src]
fn f(&Self, &X) -> f64
[src]
fn draw<R>(&Self, &mut R) -> X where
R: Rng,
[src]
R: Rng,
fn sample<R>(&Self, usize, &mut R) -> Vec<X> where
R: Rng,
[src]
R: Rng,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<Fx> Skewness for Fx where
Fx: Deref,
<Fx as Deref>::Target: Skewness,
[src]
Fx: Deref,
<Fx as Deref>::Target: Skewness,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<Fx, X> Support<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Support<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Support<X>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<Fx, X> Variance<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Variance<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Variance<X>,