Trait rv::traits::ConjugatePrior [−][src]
pub trait ConjugatePrior<X, Fx>: Rv<Fx> where
Fx: Rv<X> + HasSuffStat<X>, { type Posterior: Rv<Fx>; fn posterior(&self, x: &DataOrSuffStat<X, Fx>) -> Self::Posterior; fn ln_m(&self, x: &DataOrSuffStat<X, Fx>) -> f64; fn ln_pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64; fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64 { ... } fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64 { ... } }
A prior on Fx
that induces a posterior that is the same form as the prior
Associated Types
Required Methods
fn posterior(&self, x: &DataOrSuffStat<X, Fx>) -> Self::Posterior
Computes the posterior distribution from the data
fn ln_m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
Log marginal likelihood
fn ln_pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
Log posterior predictive of y given x
Provided Methods
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
Marginal likelihood of x
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
Posterior Predictive distribution
Implementors
impl ConjugatePrior<bool, Bernoulli> for Beta type Posterior = Self;
impl<X: CategoricalDatum> ConjugatePrior<X, Categorical> for SymmetricDirichlet type Posterior = Dirichlet;
impl<X: CategoricalDatum> ConjugatePrior<X, Categorical> for Dirichlet type Posterior = Self;
impl ConjugatePrior<f64, Gaussian> for NormalGamma type Posterior = Self;