Importantly, we can calculate the discrete weights p α and q α using Eq. (A4) without the need for calculating partition functions. If we sample form the reference distribution, q(x) = q(x), then q α = 1/N and p α = exp(-∆u α )/ N γ=1 exp(-∆u γ ). If we sample from the refined distribution, q(x) = p(x), then q α = exp(∆u α )/ N γ=1 exp(∆u γ ) and p α = 1/N . In BioEn ensemble refinement, we calculate the probabilities q α for the reference ensembles as 1/N for unbiased simulations in agreement with Eq. (A4). We obtain reference weights from biased simulations by reweighting, e.g., using MBAR or (binless) WHAM. We obtain the optimal probabilities p α by maximizing the posterior, Eq. ( ), or equivalently by minimizing the negative log-likelihood, Eq. ( ).