betting_combat.strategies.rounds_bars_bayes
rounds_bars_bayes — the structural fair value on the bars (Sam 2026-11-21): a Bayesian hazard, no trees. The chance the fight ends this round at a bar =
logit p = alpha[round] + beta x_brk + gamma x_brk s + c[round] s + g_brk brk + g_last last + g_five five + sum_j w_j f_j
alpha[round] a level a round, shrunk to one: alpha ~ N(mu_a, 0.5), mu_a ~ N(0, 1)beta trust in the break price: N(1, 0.2) - believe the market's break price unless the data say otherwisegamma, c how the anchor and the clock fade through the round (s = the share of the round fought): N(0, 0.5)g_* the break, the last round, a five-rounder: N(0, 0.5)w_j the bars' information - flows as log(1 + x), imbalances as a signed log, the parts' prices as log-odds with a 'traded in this bar' flag - standardised, shrunk: N(0, tau), tau ~ HalfNormal(0.3)fitted variationally (NumPyro SVI, a diagonal normal guide, Adam): ~1 minute a fit; the fair = the posterior mean’s logit
(BayesBars.p_ends). Used through RoundsBars as model = 'bayes' (the same rows, design, rule, backtest and live path).
Classes
BayesBars
One fit (module doc); params: the posterior means and the standardisation, JSON-able.
fit
fit(D: pd.DataFrame, rows: pd.DataFrame, cols: list[str], y: np.ndarray) -> BayesBarslogits
logits(D: pd.DataFrame, rows: pd.DataFrame) -> np.ndarrayFunctions
transform
transform(D: pd.DataFrame, cols: list[str], has: list[str] | None = None) -> tuple[np.ndarray, list[str]]The bars’ information for the Bayes: flows log(1 + x), imbalances sign(x) log(1 + |x|), prices (already log-odds from the
design) as they are plus a ‘has a value’ flag for the ones that can be blank (has: the FIT’s list of those, so a
prediction’s matrix has the fit’s shape); blanks 0 after the transform.