pub struct Gamma { /* private fields */ }Expand description
Gamma distribution (shape/rate parameterization), conjugate prior for Poisson likelihood.
After observing a count c (one observation), the posterior is
Gamma(shape + c, rate + 1).
Implementations§
Source§impl Gamma
impl Gamma
Sourcepub fn new(shape: f64, rate: f64) -> Result<Self>
pub fn new(shape: f64, rate: f64) -> Result<Self>
Create a Gamma distribution with given shape (α) and rate (β).
Both must be positive.
Sourcepub fn update_poisson(&self, count: u64) -> Self
pub fn update_poisson(&self, count: u64) -> Self
Posterior after observing a single Poisson count.
Sourcepub fn update_poisson_batch(&self, counts: &[u64]) -> Self
pub fn update_poisson_batch(&self, counts: &[u64]) -> Self
Posterior after observing multiple Poisson counts.
Trait Implementations§
Source§impl Distribution for Gamma
impl Distribution for Gamma
impl Copy for Gamma
Auto Trait Implementations§
impl Freeze for Gamma
impl RefUnwindSafe for Gamma
impl Send for Gamma
impl Sync for Gamma
impl Unpin for Gamma
impl UnsafeUnpin for Gamma
impl UnwindSafe for Gamma
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more