KatInterview

Comparing Bayesian and Frequentist Decision Rules in A/B Testing

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentsstatisticsab-testingbayesian-inference

Last updated

Analyze an A/B experiment using Bayesian posteriors, expected loss decision rules, sequential peeking effects, and prior calibration techniques.

You run an online experiment evaluating a proposed change against a baseline control. Both arms start with uninformative $\text{Beta}(1, 1)$ priors over their respective success probabilities. You collect sample sizes of $n_A = 10,000$ and $n_B = 10,000$, observing $k_A = 500$ and $k_B = 515$ conversions.

Address each of the following components:

  1. Posterior Computations: Compute the exact parameters of the posterior distributions for both variants. Derive the posterior distribution of the absolute conversion rate difference $D = \theta_B - \theta_A$ using a normal approximation, and calculate the posterior probability that the treatment outperforms the control ($\mathbb{P}(D > 0)$).
  2. Decision Theory Framework: Formulate a quantitative decision rule grounded in expected loss under asymmetric costs (where shipping a non-performing feature incurs a higher cost than withholding a performant one). Calculate the expected loss for both actions based on the experimental data.
  3. Sequential Monitoring & Methodology Comparison: Contrast the decision framework with standard frequentist hypothesis testing. Explain the consequences of continuous monitoring (optional stopping) under both frameworks, detailing techniques such as $\alpha$-spending and always-valid inference.
  4. Prior Calibration & Shrinkage: Explain why standard uninformative priors (like $\text{Beta}(1, 1)$) can lead to over-optimistic conclusions (the winner's curse). Detail how to construct realistic, calibrated prior distributions using empirical Bayes or expert elicitation.

Hints

Hint 1

Recall that the Beta distribution is the conjugate prior for Binomial data, yielding a Beta(alpha + successes, beta + failures) posterior.

Hint 2

For large sample sizes, the difference between two Beta-distributed random variables can be closely approximated by a Normal distribution whose mean is the difference of posterior means and variance is the sum of posterior variances.

Hint 3

Expected loss for a decision involves integrating the magnitude of regret over the region where the decision is incorrect, which can be evaluated analytically for Gaussian approximations using the standard normal PDF and CDF.