Skip to content

Mixture Distribution¤

distreqx.distributions.mixture_same_family.MixtureSameFamily (AbstractSTDDistribution, AbstractSampleLogProbDistribution, AbstractSurivialDistribution, AbstractProbDistribution, AbstractCDFDistribution) ¤

Mixture with components provided from a single vmapped distribution.

__init__(self, mixture_distribution: Categorical, components_distribution: AbstractDistribution) ¤

Initializes a mixture distribution for components of a shared family.

Arguments:

  • mixture_distribution: Distribution over selecting components.
  • components_distribution: Component distribution.
posterior_marginal(self, observation: Array) -> Categorical ¤

Generate the posterior distribution given a datapoint.

Arguments:

  • observation: the data point to compute the distribution over

Returns:

The computed categorical distribution

posterior_mode(self, observation: Array) -> Array ¤

Compute the most likely component a data point falls into.

Arguments:

  • observation: the data point to compute the mode of

Returns:

The computed mode