osmose.calibration.uq.sampler

Posterior sampling from Phase 2a’s log_posterior via nested sampling (dynesty).

Takes log_posterior as an INJECTED callable so it tests on the synthetic posterior without run.py. DynestySampler was chosen over emcee empirically (faster, native dlogz convergence, weighted samples, spec default); EmceeSampler is a deferred drop-in. dynesty is lazy-imported inside DynestySampler.sample so SamplerResult / check_dimension work without it.

dynesty separates prior (unit-cube transform) from likelihood. This works with Phase 2a’s combined log_posterior ONLY because the prior is uniform: the box prior_transform evaluates log_posterior exclusively inside the box, where log_prior == 0, so log_posterior == the log-likelihood there. A non-uniform prior would silently drop the prior term — do not swap one in without separating it.

Functions

check_dimension(n_dim[, max_dim])

Hard nominal-dimension cap: raise above the trustworthy envelope, regardless of any emulator-gate pass (concentration of measure + ensemble-sampler mixing).

Classes

DynestySampler([nlive, dlogz, ess_min, ...])

Nested-sampling posterior sampler (dynesty) over a uniform box prior.

SamplerResult(samples, weights, logz, ...)

Posterior samples + weights + evidence, with weight-aware summaries.