[][src]Trait grandma::plugins::distributions::DiscreteDistribution

pub trait DiscreteDistribution: Clone + 'static {
    fn ln_prob(&self, child: Option<&NodeAddress>) -> Option<f64>;
fn kl_divergence(&self, other: &Self) -> Option<f64>; }

Required methods

fn ln_prob(&self, child: Option<&NodeAddress>) -> Option<f64>

Pass none if you want to test for a singleton, returns 0 if

fn kl_divergence(&self, other: &Self) -> Option<f64>

Computes the KL divergence of two bucket probs. KL(self || other) Returns None if the support of the self is not a subset of the support of the other, or the calculation is undefined.

Loading content...

Implementors

impl DiscreteDistribution for Categorical[src]

fn ln_prob(&self, loc: Option<&NodeAddress>) -> Option<f64>[src]

Pass none if you want to test for a singleton, returns 0 if

fn kl_divergence(&self, other: &Categorical) -> Option<f64>[src]

Computes the KL divergence of two bucket probs. KL(self || other) Returns None if the support of the self is not a subset of the support of the other

impl DiscreteDistribution for Dirichlet[src]

fn kl_divergence(&self, other: &Dirichlet) -> Option<f64>[src]

from http://bariskurt.com/kullback-leibler-divergence-between-two-dirichlet-and-beta-distributions/ We assume that the Dirichlet distribution passed into this one is conditioned on this one! It assumes they have the same keys!

Loading content...