pub struct Model<L, Pr, Po, Payload = ()>{ /* private fields */ }
Expand description
Bayesian model, consisting of a prior, a posterior and a likelihood model.
Thereby, Payload
is a custom payload of the model instance.
This can be used to define custom caching mechanisms. See
here
for an example.
Implementations§
source§impl<Event, PosteriorEvent, Data, L, Pr, Po, Payload> Model<L, Pr, Po, Payload>
impl<Event, PosteriorEvent, Data, L, Pr, Po, Payload> Model<L, Pr, Po, Payload>
pub fn likelihood(&self) -> &L
pub fn likelihood_mut(&mut self) -> &mut L
pub fn prior(&self) -> &Pr
pub fn prior_mut(&mut self) -> &mut Pr
pub fn posterior(&self) -> &Po
pub fn posterior_mut(&mut self) -> &mut Po
sourcepub fn compute<U: IntoIterator<Item = PosteriorEvent>>(
&self,
universe: U,
data: &Data
) -> ModelInstance<Event, PosteriorEvent>
pub fn compute<U: IntoIterator<Item = PosteriorEvent>>( &self, universe: U, data: &Data ) -> ModelInstance<Event, PosteriorEvent>
Compute model for a given universe of events.
sourcepub fn compute_from_marginal<M>(
&self,
marginal: &M,
data: &Data
) -> ModelInstance<Event, PosteriorEvent>where
M: Marginal<Data = Data, Event = PosteriorEvent, BaseEvent = Event>,
pub fn compute_from_marginal<M>(
&self,
marginal: &M,
data: &Data
) -> ModelInstance<Event, PosteriorEvent>where
M: Marginal<Data = Data, Event = PosteriorEvent, BaseEvent = Event>,
Compute model via the exploration of the marginal distribution of the data.
Trait Implementations§
source§impl<'de, L, Pr, Po, Payload> Deserialize<'de> for Model<L, Pr, Po, Payload>where
L: Likelihood<Payload> + Deserialize<'de>,
Pr: Prior + Deserialize<'de>,
Po: Posterior + Deserialize<'de>,
Payload: Default,
impl<'de, L, Pr, Po, Payload> Deserialize<'de> for Model<L, Pr, Po, Payload>where
L: Likelihood<Payload> + Deserialize<'de>,
Pr: Prior + Deserialize<'de>,
Po: Posterior + Deserialize<'de>,
Payload: Default,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<L, Pr, Po, Payload> Ord for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> Ord for Model<L, Pr, Po, Payload>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<L, Pr, Po, Payload> PartialEq for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> PartialEq for Model<L, Pr, Po, Payload>
source§impl<L, Pr, Po, Payload> PartialOrd for Model<L, Pr, Po, Payload>where
L: Likelihood<Payload> + PartialOrd,
Pr: Prior + PartialOrd,
Po: Posterior + PartialOrd,
Payload: Default + PartialOrd,
impl<L, Pr, Po, Payload> PartialOrd for Model<L, Pr, Po, Payload>where
L: Likelihood<Payload> + PartialOrd,
Pr: Prior + PartialOrd,
Po: Posterior + PartialOrd,
Payload: Default + PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<L, Pr, Po, Payload> Copy for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> Eq for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> StructuralPartialEq for Model<L, Pr, Po, Payload>
Auto Trait Implementations§
impl<L, Pr, Po, Payload> Freeze for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> RefUnwindSafe for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> Send for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> Sync for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> Unpin for Model<L, Pr, Po, Payload>
impl<L, Pr, Po, Payload> UnwindSafe for Model<L, Pr, Po, Payload>
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.