[−][src]Struct rv::dist::Poisson
Possion distribution over x in {0, 1, ... }.
Example
use rv::prelude::*; // Create Possion(λ=5.3) let pois = Poisson::new(5.3).unwrap(); // CDF at 5 assert!((pois.cdf(&5_u16) - 0.56347339228807169).abs() < 1E-12); // Draw 100 samples let mut rng = rand::thread_rng(); let xs: Vec<u32> = pois.sample(100, &mut rng); assert_eq!(xs.len(), 100)
Methods
impl Poisson
[src]
impl Poisson
[src]
pub fn new(rate: f64) -> Result<Self>
[src]
Create a new Possion distribution with given rate
pub fn new_unchecked(rate: f64) -> Self
[src]
Creates a new Poisson without checking whether the parameter is valid.
pub fn rate(&self) -> f64
[src]
Trait Implementations
impl Rv<u8> for Poisson
[src]
fn ln_f(&self, x: &u8) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u8
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u8>
[src]
fn f(&self, x: &X) -> f64
[src]
impl Rv<u16> for Poisson
[src]
fn ln_f(&self, x: &u16) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u16
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u16>
[src]
fn f(&self, x: &X) -> f64
[src]
impl Rv<u32> for Poisson
[src]
fn ln_f(&self, x: &u32) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u32
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u32>
[src]
fn f(&self, x: &X) -> f64
[src]
impl Rv<Poisson> for Gamma
[src]
fn ln_f(&self, x: &Poisson) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> Poisson
[src]
fn f(&self, x: &X) -> f64
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
impl Support<u8> for Poisson
[src]
impl Support<u16> for Poisson
[src]
impl Support<u32> for Poisson
[src]
impl Support<Poisson> for Gamma
[src]
impl ContinuousDistr<Poisson> for Gamma
[src]
impl Cdf<u8> for Poisson
[src]
impl Cdf<u16> for Poisson
[src]
impl Cdf<u32> for Poisson
[src]
impl DiscreteDistr<u8> for Poisson
[src]
impl DiscreteDistr<u16> for Poisson
[src]
impl DiscreteDistr<u32> for Poisson
[src]
impl Mean<f64> for Poisson
[src]
impl Variance<f64> for Poisson
[src]
impl Skewness for Poisson
[src]
impl Kurtosis for Poisson
[src]
impl HasSuffStat<u8> for Poisson
[src]
type Stat = PoissonSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
impl HasSuffStat<u16> for Poisson
[src]
type Stat = PoissonSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
impl HasSuffStat<u32> for Poisson
[src]
type Stat = PoissonSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
impl ConjugatePrior<u8, Poisson> for Gamma
[src]
type Posterior = Self
fn posterior(&self, x: &DataOrSuffStat<u8, Poisson>) -> Self
[src]
fn ln_m(&self, x: &DataOrSuffStat<u8, Poisson>) -> f64
[src]
fn ln_pp(&self, y: &u8, x: &DataOrSuffStat<u8, Poisson>) -> f64
[src]
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
impl ConjugatePrior<u16, Poisson> for Gamma
[src]
type Posterior = Self
fn posterior(&self, x: &DataOrSuffStat<u16, Poisson>) -> Self
[src]
fn ln_m(&self, x: &DataOrSuffStat<u16, Poisson>) -> f64
[src]
fn ln_pp(&self, y: &u16, x: &DataOrSuffStat<u16, Poisson>) -> f64
[src]
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
impl ConjugatePrior<u32, Poisson> for Gamma
[src]
type Posterior = Self
fn posterior(&self, x: &DataOrSuffStat<u32, Poisson>) -> Self
[src]
fn ln_m(&self, x: &DataOrSuffStat<u32, Poisson>) -> f64
[src]
fn ln_pp(&self, y: &u32, x: &DataOrSuffStat<u32, Poisson>) -> f64
[src]
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
impl<'_> From<&'_ Poisson> for String
[src]
impl Clone for Poisson
[src]
impl PartialEq<Poisson> for Poisson
[src]
impl PartialOrd<Poisson> for Poisson
[src]
fn partial_cmp(&self, other: &Poisson) -> Option<Ordering>
[src]
fn lt(&self, other: &Poisson) -> bool
[src]
fn le(&self, other: &Poisson) -> bool
[src]
fn gt(&self, other: &Poisson) -> bool
[src]
fn ge(&self, other: &Poisson) -> bool
[src]
impl Display for Poisson
[src]
impl Debug for Poisson
[src]
Auto Trait Implementations
impl Send for Poisson
impl Sync for Poisson
impl Unpin for Poisson
impl UnwindSafe for Poisson
impl RefUnwindSafe for Poisson
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<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<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,