Skip to content

Round-Trip Diagnostics#

Functions for measuring tempering performance: round-trip rates, the communication barrier Λ, and chain count recommendations.

hamon.round_trip_summary(index_state: dict, rejection_rates: jax.Array, betas: jax.Array, n_rounds: int) -> dict #

Compute full diagnostic summary for NRPT run.

Returns dict with

Lambda: global communication barrier estimate tau_predicted: theoretical optimal round trip rate tau_observed: empirical round trip rate efficiency: tau_observed / tau_predicted (closer to 1 = better) lambda_profile: local barrier at each pair midpoint round_trips_per_chain: per-machine round trip counts restarts_per_chain: per-machine restart counts

hamon.recommend_n_chains(Lambda: float | jax.Array, target_acceptance: float = 0.6) -> int #

Suggest chain count for a given barrier and target acceptance rate.

For NRPT with equalized rejection rates: Nr ≈ Λ where r = 1 - target_acceptance. Solving: N = Λ / r* = Λ / (1 - target_acceptance).

The default target_acceptance=0.6 means 40% rejection per pair.

Note: Λ from too few chains is biased low. Use discover_chain_count for iterative bootstrapping if recommendations keep increasing.

Parameters:

Name Type Description Default
Lambda float | Array

estimated global communication barrier

required
target_acceptance float

desired per-pair acceptance rate (default: 0.6 = 60%)

0.6

Returns:

Type Description
int

Recommended number of chains (minimum 2).