jaxrens.postprocess.thermodynamics

Thermodynamic post-processing of nested sampling results.

NumPy-based for unconditional float64 precision. Sampling is pinned to float32 by the root __init__ (see the comment there); post-processing runs in a separate process, so the precision regimes don’t interfere.

Energy convention: E = -log(L), so higher energy = lower likelihood.

Batch-shape support

All public functions accept dead_energies with arbitrary leading batch dimensions (*batch, max_dead). Output shape mirrors the input batch prefix (output of the trailing axis-reduction). Examples:

  • (max_dead,) → scalar output

  • (n_runs, max_dead) → (n_runs,)

  • (G, P, max_dead) → (G, P)

JAX-array inputs are auto-converted to NumPy via np.asarray; outputs are always NumPy float64 (or 0-d / array thereof). JIT-compilation of these functions is not supported; they run on the host in fp64. Cv etc. on a (n_dead,) array of a few thousand entries is far below the cost of a typical sampling iteration, so JITability bought nothing in practice while masking precision loss.

Functions

calc_log_weights

Compute log prior-mass weights for dead points.

calc_log_weights_live

Compute log weight for each remaining live walker.

expectation

Thermal expectation <O>(beta) for an observable on the dead+live set.

free_energy

Helmholtz free energy F = -log Z(beta) / beta.

heat_capacity

Heat capacity C_v(beta) = beta² · Var(E) at inverse temperature beta.

log_evidence

Total log evidence log Z from dead and live points.

partition_function

Log partition function log Z(beta) at inverse temperature beta.