Wait, it's all histograms? Simplifying our Bayesian A/B testing methodology - Part 2

Tom Armitage, Dustin Hayden15 Aug 2024

Problem

Auto Trader UK reads its A/B tests with a Bayesian method. Each metric needs a likelihood, and real metrics rarely match a standard one. Only conjugate likelihood-prior pairs give a posterior with a closed form, and non-conjugate choices need finicky sampling. Stakeholders ask for many metrics, and each metric's distribution drifts, so a hand-built model for each metric takes too long. A wrong likelihood gives a wrong posterior and a bad decision.

Example from the article: a simulated click-through rate (CTR) metric bounded between 0 and 1 has a very irregular histogram, while the group means are almost identical.

Solution in brief

Treat every metric as a histogram. Put observations into bins, model the bin counts as a Categorical distribution and use its conjugate Dirichlet prior. Sample the Dirichlet posterior to get a distribution of the population mean per variant. With more than about 100 bins the result matched bootstrap estimates in simulations.

Questions this case answers
  • How to analyse experiments with Bayesian posteriors when metric distributions are irregular and change over time, and no standard likelihood fits
  • How to run Bayesian A/B tests on messy metrics without picking a likelihood for each one?
  • How to choose the number of bins when a metric is approximated by a histogram?
  • How to check that a generic Bayesian model gives honest uncertainty on a metric?

Tools and methods

  • Dirichlet-Categorical model — replaces a per-metric likelihood with binned data and a conjugate prior
  • Chance to Beat and Expected Loss — decision metrics computed from variant posteriors
  • Bootstrap — reference for checking the posterior's uncertainty
  • Quantile-spaced bins — recommended bin edges instead of linear spacing
Continue reading — it's free

Google or a one-time email code. No password.