pub trait Distribution: Clone + Debug + Send + Sync {
    type Value: RandomVariable;
    type Condition: Clone + Debug + Send + Sync;

    // Required method
    fn p_kernel(
&self,
x: &Self::Value,
theta: &Self::Condition
) -> Result<f64, DistributionError>; }
Expand description

The trait which all structs of distribution must implement.

  • fk: The kernel part of probability density function f. The kernel means that it doesn’t need normalization term of probability density function.

Required Associated Types§

Required Methods§

source

fn p_kernel(
&self,
x: &Self::Value,
theta: &Self::Condition
) -> Result<f64, DistributionError>

Implementors§

source§

impl Distribution for Dirichlet

source§

impl Distribution for Beta

source§

impl Distribution for Cauchy

source§

impl Distribution for Normal

source§

impl Distribution for StudentT

source§

impl Distribution for Exp

source§

impl Distribution for FisherF

source§

impl Distribution for InverseWishart

source§

impl Distribution for NormalInverseWishart

source§

impl Distribution for Wishart

source§

impl Distribution for ChiSquared

source§

impl Distribution for Gamma

source§

impl Distribution for ContinuousUniform

p returns the constant multiplied value so it can be used only for MCMC.

source§

impl Distribution for Geometric

source§

impl Distribution for Bernoulli

source§

impl Distribution for Categorical

source§

impl Distribution for Binomial

source§

impl Distribution for Multinominal

source§

impl Distribution for Poisson

source§

impl Distribution for StickBreakingProcess

source§

impl<'a, D, T, U> Distribution for SwitchedDistribution<'a, D, T, U>where
D: Distribution<Value = T, Condition = U>,
T: RandomVariable,
U: Event,

source§

impl<'a, G0, TH> Distribution for PitmanYorGibbs<'a, G0, TH>where
G0: Distribution<Value = TH, Condition = ()>,
TH: RandomVariable,

source§

impl<D, T1, T2, U, F> Distribution for ValuedDistribution<D, T1, T2, U, F>where
D: Distribution<Value = T1, Condition = U>,
T1: RandomVariable,
T2: RandomVariable,
U: Event,
F: Fn(&T2) -> Result<T1, DistributionError> + Clone + Send + Sync,

§

type Value = T2

§

type Condition = U

source§

impl<D, T1, T2, U, F, G> Distribution for ValueDifferentiableValuedDistribution<D, T1, T2, U, F, G>where
D: Distribution<Value = T1, Condition = U>,
T1: RandomVariable,
T2: RandomVariable,
U: Event,
F: Fn(&T2) -> Result<T1, DistributionError> + Clone + Send + Sync,
G: Fn(&T2) -> Matrix + Clone + Send + Sync,

§

type Value = T2

§

type Condition = U

source§

impl<D, T, U1, U2, F> Distribution for ConditionedDistribution<D, T, U1, U2, F>where
D: Distribution<Value = T, Condition = U1>,
T: RandomVariable,
U1: Event,
U2: Event,
F: Fn(&U2) -> Result<U1, DistributionError> + Clone + Send + Sync,

§

type Value = T

§

type Condition = U2

source§

impl<D, T, U1, U2, F, G> Distribution for ConditionDifferentiableConditionedDistribution<D, T, U1, U2, F, G>where
D: Distribution<Value = T, Condition = U1>,
T: RandomVariable,
U1: Event,
U2: Event,
F: Fn(&U2) -> Result<U1, DistributionError> + Clone + Send + Sync,
G: Fn(&U2) -> Matrix + Clone + Send + Sync,

§

type Value = T

§

type Condition = U2

source§

impl<D, T, U> Distribution for IndependentArrayJoint<D, T, U>where
D: Distribution<Value = T, Condition = U>,
T: RandomVariable,
U: RandomVariable,

§

type Value = Vec<T, Global>

§

type Condition = Vec<U, Global>

source§

impl<D, T, U> Distribution for IndependentValueArrayJoint<D, T, U>where
D: Distribution<Value = T, Condition = U>,
T: RandomVariable,
U: RandomVariable,

§

type Value = Vec<T, Global>

§

type Condition = U

source§

impl<D, T, U, V> Distribution for TransformedDistribution<D, T, U, V>where
D: Distribution<Value = T, Condition = U>,
T: RandomVariable,
U: RandomVariable,
V: RandomVariable,

source§

impl<L, P, A, B> Distribution for DiscretePosterior<L, P, A, B>where
L: Distribution<Value = A, Condition = B>,
P: Distribution<Value = B, Condition = ()>,
A: RandomVariable,
B: RandomVariable + Eq + Hash,

§

type Value = B

§

type Condition = A

source§

impl<L, R, T, UL, UR> Distribution for DependentJoint<L, R, T, UL, UR>where
L: Distribution<Value = T, Condition = UL>,
R: Distribution<Value = UL, Condition = UR>,
T: RandomVariable,
UL: RandomVariable,
UR: Event,

§

type Value = (T, UL)

§

type Condition = UR

source§

impl<L, R, TL, TR, U> Distribution for IndependentJoint<L, R, TL, TR, U>where
L: Distribution<Value = TL, Condition = U>,
R: Distribution<Value = TR, Condition = U>,
TL: RandomVariable,
TR: RandomVariable,
U: Event,

source§

impl<S, A, K> Distribution for GeneralizedKernelDensityEstimation<S, A, K>where
S: RandomVariable,
A: RandomVariable,
K: PositiveDefiniteKernel<Vec<f64>>,

§

type Value = A

§

type Condition = S

source§

impl<T> Distribution for MultivariateCauchy<T>where
T: EllipticalParams,

§

type Value = Vec<f64, Global>

§

type Condition = T

source§

impl<T> Distribution for MultivariateNormal<T>where
T: EllipticalParams,

§

type Value = Vec<f64, Global>

§

type Condition = T

source§

impl<T> Distribution for DiscreteUniform<T>where
T: RandomVariable + Eq + Hash,

source§

impl<T> Distribution for ContinuousSamplesDistribution<T>where
T: RandomVariable + PartialEq,

§

type Value = T

§

type Condition = ()

source§

impl<T> Distribution for Degenerate<T>where
T: RandomVariable + PartialEq,

§

type Value = T

§

type Condition = ()

source§

impl<T> Distribution for DiscreteSamplesDistribution<T>where
T: RandomVariable + Eq + Hash,

§

type Value = T

§

type Condition = ()

source§

impl<T, U> Distribution for MultivariateStudentT<T, U>where
T: MultivariateStudentTParams<U>,
U: EllipticalParams,

§

type Value = Vec<f64, Global>

§

type Condition = T

source§

impl<T, U, FF, FS> Distribution for InstantDistribution<T, U, FF, FS>where
T: RandomVariable,
U: RandomVariable,
FF: Fn(&T, &U) -> Result<f64, DistributionError> + Clone + Send + Sync,
FS: Fn(&U, &mut dyn RngCore) -> Result<T, DistributionError> + Clone + Send + Sync,

§

type Value = T

§

type Condition = U

source§

impl<T, U, FF, FS, G> Distribution for ConditionDifferentiableInstantDistribution<T, U, FF, FS, G>where
T: RandomVariable,
U: RandomVariable,
FF: Fn(&T, &U) -> Result<f64, DistributionError> + Clone + Send + Sync,
FS: Fn(&U, &mut dyn RngCore) -> Result<T, DistributionError> + Clone + Send + Sync,
G: Fn(&T, &U) -> Result<Vec<f64>, DistributionError> + Clone + Send + Sync,

§

type Value = T

§

type Condition = U

source§

impl<T, U, FF, FS, G> Distribution for ValueDifferentiableInstantDistribution<T, U, FF, FS, G>where
T: RandomVariable,
U: RandomVariable,
FF: Fn(&T, &U) -> Result<f64, DistributionError> + Clone + Send + Sync,
FS: Fn(&U, &mut dyn RngCore) -> Result<T, DistributionError> + Clone + Send + Sync,
G: Fn(&T, &U) -> Result<Vec<f64>, DistributionError> + Clone + Send + Sync,

§

type Value = T

§

type Condition = U