mixle.stats.parameter_packing module¶
Primary-parameter packing for extrapolation-based EM acceleration (SQUAREM).
This lives in the stats layer on purpose: the (extract, rebuild) handlers must name concrete
distribution families, which orchestration-level modules (mixle.inference.em – see its module
docstring and compute_metadata_test’s guard) are architecturally barred from doing. The consumer is
mixle.inference.em.SquaremEM, which imports only the packer FUNCTION.
- squarem_packer(model)[source]
Build
(pack, unpack)forSquaremEMovermodel’s primary parameters.Supported out of the box: recursively nested
MixtureDistributionandCompositeDistributionnodes with Gaussian / Laplace / Exponential / Poisson / Categorical leaves and no priors attached (a MAP fit changes the fixed point). Anything else raisesNotImplementedErrorwith the escape hatch named: pass an explicitpacker=(pack, unpack)toSquaremEMfor custom models.pack(model) -> thetaandunpack(theta) -> modelround-trip losslessly (asserted in tests); mixture weights travel as log-weights re-normalized on unpack.