← Back to Index

Proof of Concept / Bayesian Decision Science

Bayesian A/B Testing
Engine

Adaptive Campaign Optimization for IgA Nephropathy

A Thompson Sampling engine for optimizing pharma digital marketing campaigns targeting nephrologists. This proof of concept demonstrates how Bayesian inference adaptively allocates campaign budget across creative variants in real time — maximizing HCP engagement while minimizing wasted impressions on underperforming content. Built entirely in-browser with no backend dependencies.

Bayesian InferenceThompson SamplingBeta-BinomialPosterior DistributionsExpected LossAdaptive Allocation

Disclaimer: This is a proof-of-concept demonstration using synthetic data and simulated campaign parameters. All conversion rates, budget figures, and campaign configurations are illustrative and do not represent actual campaign data, clinical outcomes, or commercial strategies of Travere Therapeutics or any other entity. This tool is NOT intended to guide actual marketing spend decisions.

Running Thompson sampling simulation...

Technical Architecture

Bayesian Engine

Beta-Binomial conjugate model with closed-form posterior updates. Each variant maintains a Beta(alpha, beta) posterior that updates incrementally with each observed conversion or non-conversion. Log-space computation via Lanczos approximation ensures numerical stability for large alpha/beta values.

Thompson Sampling

Adaptive allocation algorithm that balances exploration and exploitation. Each round, the engine samples from each variant's posterior and allocates the next impression to the variant with the highest sample. Seeded Mulberry32 PRNG ensures full reproducibility across simulation runs.

Decision Theory

Expected loss and probability of being best computed via 10,000 Monte Carlo samples from the joint posterior. Dual decision threshold (P(best) > 95% AND expected loss < 0.1%) ensures both statistical confidence and practical significance before declaring a winner.

References

  • Thompson WR. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika. 1933;25(3/4):285-294.
  • Russo DJ, Van Roy B, Kazerouni A, Osband I, Wen Z. A tutorial on Thompson Sampling. Foundations and Trends in Machine Learning. 2020;11(1):1-96.
  • Scott SL. A modern Bayesian look at the multi-armed bandit. Applied Stochastic Models in Business and Industry. 2010;26(6):639-658.
  • Chapell R. Multi-armed bandit experiments in the online service economy. Applied Stochastic Models in Business and Industry. 2015;31(1):37-45.
  • Rodrigues RG, et al. IgA nephropathy. Clinical Journal of the American Society of Nephrology. 2017;12(4):677-686.
  • Heerspink HJL, et al. Sparsentan in patients with IgA nephropathy: a prespecified interim analysis of a randomised, double-blind, active-controlled clinical trial (PROTECT). Lancet. 2023;401(10388):1584-1594.