Parameter Samplers

Each module on this page implements one conditional Gibbs sampling step. They are normally called by TOD_Gibbs_sampler(), but can also be used standalone when only one block of parameters needs to be updated.

Gibbs step summary

Module

Parameters sampled

Entry point

gain_sampler

Smooth gain coefficients \(\mathbf{p}_g\)

gain_sampler()

tsys_sampler

System temperature \(\mathbf{p}_{\rm loc}\), \(\mathbf{p}_{\rm sky}\)

Tsys_sampler_multi_TODs()

noise_sampler_fixed_fc

Noise params \((\log f_0, \alpha)\)preferred

flicker_sampler()

noise_sampler_old

Noise params \((\log f_0, \alpha)\) — legacy

flicker_noise_sampler()

Gain Sampler

Samples the Legendre-polynomial gain coefficients conditioned on the current system temperature and noise parameters. Supports three gain models: "linear", "log", and "factorized" (DC gain + fluctuations). The main entry point is gain_sampler(), which dispatches to the model-specific function via its model string argument.

System Temperature Sampler

Samples sky and local temperature coefficients conditioned on gains and noise. Use Tsys_coeff_sampler() for a single TOD (no MPI required) or Tsys_sampler_multi_TODs() to jointly sample shared sky parameters across multiple TODs via MPI. Set Est_mode=True to return the MAP estimate instead of a posterior sample (useful for burn-in).

Noise Sampler (Fixed Cutoff)

The preferred noise-parameter sampler. Samples \((\log f_0, \alpha)\) with the cutoff frequency \(f_c\) fixed. Supports both emcee (default) and NUTS backends. Set consecutive=False together with time_list to handle flagged or non-contiguous time samples.

Noise Sampler (Legacy)

Legacy emcee-only noise sampler. Still called internally by TOD_Gibbs_sampler() when sampler="emcee_old" is requested. For new code, prefer noise_sampler_fixed_fc.

MCMC Sampler

Low-level emcee ensemble sampler wrapper used by the noise samplers above. Not intended to be called directly in most workflows.

NUTS Sampler

Low-level NumPyro/JAX No-U-Turn Sampler wrapper used by noise_sampler_fixed_fc when sampler="NUTS". Requires JAX and NumPyro to be installed.

Local Parameter Sampler

Specialised sampler for local (per-TOD) temperature parameters used when the sky and local components are sampled jointly.

Bayesian Utilities

Helper functions for prior wrapping, parameter transformations (constrained ↔ unconstrained), and Jeffreys prior construction. Used internally by the noise samplers.