Repository navigation
v0.8.0
Hierarchical-model usability: fit now exposes method= / guide= / reparameterize= knobs, random-effect terms emit non-centered by default (no more funnel), and the NUTS / HMC scalar-vs-plate broadcasting bug is fixed. Tutorial 8 walks the formula → fit → diagnostics pipeline end-to-end against the running runtime.
Changed
- BREAKING:
fit(..., sampler=...)renamed tofit(..., method=...). SVI is not a sampler (it fits a variationalGuideby optimization); the parameter selects an inference algorithm. The literal values ("nuts","hmc","svi") are unchanged. Update call sitessampler="..."→method="...". - BREAKING: random-effect terms emitted in non-centered form by default.
(slope | g)formulae now compile to a standard-Normal plate drawz_g_<slope> : g <- Normal(0, 1)plus a deterministiclet alpha_g_per_row = sigma_g * z_g_<slope>[g_idx], rather than the textbook centeredalpha_g : g <- Normal(0, sigma_g). Same posterior mathematically; the funnel that wrecks centered hierarchical sampling under HMC / NUTS and under-shrinks variance components under VI is gone. Passfit(..., reparameterize="centered")to recover the previous behaviour.
Added
fit(..., guide=...)exposes guide selection for SVI (previously hard-coded toAutoNormalGuide). Accepts anyGuidesubclass:AutoMultivariateNormalGuide,AutoLowRankMultivariateNormalGuide,AutoLaplaceApproximation,AutoIAFGuide, etc. The class is constructed internally with(program, observed_names=...).fit(..., reparameterize=...)controls the parameterization of random effects."noncentered"(default; recommended by Stan / brms) or"centered".formula_to_qvrtakes the same parameter;BayesianFit.reparameterizerecords the choice soqvr_sourceechoes the actual emitted form.- Tutorial 8: Analysis pipelines. Step-by-step walkthrough of the formula → fit → diagnostics surface on synthetic data: Gaussian SVI fit, hierarchical SVI, NUTS Bernoulli + PSIS-LOO model comparison, ArviZ posterior-predictive checks, the lens round-trip. Every Python block verified end-to-end against the running runtime.
Fixed
- NUTS / HMC on hierarchical formula models no longer dies with
Sizes of tensors must match except in dimension 1.MonadicProgram._stack_tensorsbroadcasts size-1 leading dims against the maximum batch in the input list, so a scalar latent (sigma) and a per-row tensor (mu) can be concatenated ahead of an indexed observe.
Full Changelog: v0.7.1...v0.8.0