pub enum Distribution {
Bernoulli(f64),
Binomial(i64, f64),
Normal(f64, f64),
Gamma(f64, f64),
Beta(f64, f64),
LogNormal(f64, f64),
Categorical(Vec<f64>),
Dirichlet(Vec<f64>),
}
Expand description
Enum that uniquely discribes a given distribution.
Variants§
Bernoulli(f64)
A Bernoulli distribution with paramater p.
Binomial(i64, f64)
A Binomial distribution with paramaters n and p.
Normal(f64, f64)
A Normal distribution with paramaters mu and sigma.
Gamma(f64, f64)
A Gamma distribution with parameters alpha and beta.
Beta(f64, f64)
A Beta distribution with parameters alpha and beta.
LogNormal(f64, f64)
A Lognormal distribution with paramaters mu and sigma.
Categorical(Vec<f64>)
A Categorical distribution with weights equal to p.
Dirichlet(Vec<f64>)
A Dirichlet distribution that returns a vector of degree n.
Trait Implementations§
Source§impl Debug for Distribution
impl Debug for Distribution
Source§impl Sampleable for Distribution
impl Sampleable for Distribution
Source§fn liklihood(&self, value: &Value) -> Result<f64, &str>
fn liklihood(&self, value: &Value) -> Result<f64, &str>
Compute the liklihood of a value given a distribution (returns the log liklihood.)
§Errors
This function will return an Err if you try to determine the liklihood of a variant of the Value
enum that
the distribution does not produce. For example, trying to get the liklihood of a real number from a bernoulli
distribution will return an Err.
Auto Trait Implementations§
impl Freeze for Distribution
impl RefUnwindSafe for Distribution
impl Send for Distribution
impl Sync for Distribution
impl Unpin for Distribution
impl UnwindSafe for Distribution
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.