Latent, Bayesian, And Nonparametric Families¶
This page covers the statistical families where the model contains unobserved structure or explicit prior/posterior behavior. These are the families most closely tied to EM, variational inference, posterior inspection, and automatic model selection.
Latent Mixtures¶
Mixture families introduce hidden component assignments:
MixtureDistributionandMixtureEstimator;GaussianMixtureDistributionwhere available through the latent modules;HeterogeneousMixtureDistributionandHeterogeneousMixtureEstimator;HierarchicalMixtureDistributionandHierarchicalMixtureEstimator;JointMixtureDistributionandJointMixtureEstimator;SparseMixturevariants;SemiSupervisedMixtureDistributionandSemiSupervisedMixtureEstimator;DiracLengthMixtureDistributionandDiracLengthMixtureEstimator.
Use mixtures when observations plausibly come from several regimes but the
regime label is not observed. Use mixle.inference.best_of() or
Evolution And Search when local optima matter.
Topic, Attention, And Association Models¶
Latent structure is not only clustering. Mixle also includes topic and attention-like latent families:
LDADistributionandLDAEstimator;IntegerProbabilisticLatentSemanticIndexingDistributionand estimator;LabeledLDAfamilies;HiddenAssociationDistributionandHiddenAssociationEstimator;IntegerHiddenAssociationDistributionand estimator;SparseMarkovAssociationDistributionand estimator;ResponsibilityAttentionDistributionand estimator;VariationalEmbeddingAttentionDistributionand estimator;ChainedAttentionDistributionand estimator;VariationalMultiHopAttentionDistributionand estimator.
Use these when the latent object is an assignment, topic, association, or attention path rather than a simple mixture component.
Grammar And Circuit Families¶
Structured latent families include:
HeterogeneousPCFGDistributionandHeterogeneousPCFGEstimator;InducedHeterogeneousPCFGEstimator;ProbabilisticCircuitfamilies;ProbabilisticPCADistributionandProbabilisticPCAEstimator.
Use these when the latent structure is compositional, grammatical, circuit-like, or low-rank continuous.
Bayesian Families¶
mixle.stats.bayes provides prior and posterior-bearing families:
DirichletDistributionandDirichletEstimator;SymmetricDirichletDistribution;DictDirichletDistribution;NormalGammaDistribution;NormalWishartDistribution;MultivariateNormalGammaDistribution;ConjugatePosteriorandconjugate_posterior;MixtureConjugatePosteriorandmixture_conjugate_posterior;mixture_priorhelpers where available.
Use conjugate families when posterior updates should be closed form, streaming, or easy to audit.
Bayesian Nonparametrics¶
The nonparametric family surface includes:
DirichletProcessMixtureDistributionand estimator;HierarchicalDirichletProcessMixtureDistributionand estimator;PitmanYorProcessDistributionand estimator;IndianBuffetProcessDistributionand estimator;ChineseRestaurantProcessDistributionand estimator.
Use these when the number of clusters, features, or partitions should not be fixed too early. In deployed systems, prefer finite truncations or explicit promotion gates so the inferred complexity remains inspectable.
Posteriors¶
Posterior helper objects include:
Posterior;LatentPosterior;CategoricalLatentPosterior;MarkovChainLatentPosterior;MeanFieldLDAPosterior.
These objects are useful for exposing responsibilities, state marginals, posterior predictive behavior, and attribution from latent variables back to observed data.
Fitting Guidance¶
Latent and Bayesian models are more sensitive to initialization and objective choice than simple scalar families.
Use this default discipline:
Fit a simpler non-latent baseline.
Fit the latent model with several random starts.
Compare on held-out log score or task loss.
Inspect posterior responsibilities, not only aggregate likelihood.
Check calibration if the posterior drives decisions.
Record the chosen structure and rejected alternatives in provenance.
Example: Mixture With Restarts¶
import numpy as np
from mixle.inference import best_of
from mixle.stats import GaussianEstimator, MixtureEstimator
estimator = MixtureEstimator([GaussianEstimator(), GaussianEstimator()])
score, model = best_of(
train,
valid,
estimator,
trials=12,
max_its=100,
rng=np.random.RandomState(0),
out=None,
)
Use model only after checking that it improves validation behavior over a
single-family baseline.
Relationship To mixle.models¶
mixle.stats families are distribution families that participate directly
in the distribution/estimator contract. mixle.models contains incubating
higher-level model helpers, neural leaves, fitting utilities, graph/POMDP
helpers, and training search tools. When both namespaces contain related
ideas, prefer this rule:
use
mixle.statswhen you need a distribution family inside a composition;use
mixle.modelswhen you deliberately need a specialized model helper, external training loop, or fit-result utility and are ready to validate it.
API Reference¶
Generated reference pages: