Video 1: Bayesian A/B Testing: Introduction

Question 1: What is Bayesian A/B Testing?

In this lecture, I'm going to introduce you the A/B testing framework in Bayesian analysis. A/B testing is used everywhere. It's useful in marketing, retail, online advertising, user experience and many other domains. If you are a data scientist working on online retail, you might want to tell your supervisor that “the website design A is better than the website design B”. The underlying motivation is that you want people to actually buy stuff on your website design. So your A/B testing might be testing two different versions of online store designs and you're interested in the average revenue per customer for example, because you want to go with the one that allows you to earn more money on your website. Although it's human nature to make fast decisions according to what we observe, we can't just address evidence-based actions without evidence derived from data and statistical testing such as hypothesis testing.

First, what is A/B testing? A/B testing is a kind of randomized experiment that can compare two variants of the same thing. The goal of A/B testing is to see which variant is better. It's quite flexible to define what metric we are going to test in order to pick the better variant based on numerical comparison. But generally, it's great to think of A/B testing as comparing new ideas over an established idea. For instance, if we're comparing two website designs, we might be interested in 1) comparing if changing text and background colors on a webpage leads to more sign-ups, 2) testing if using different design layouts leads to more purchases in an online store. Bayesian A/B testing is a terminology denoting an A/B testing process for two variants using the Bayesian methods. Cool!

Question 2: Why do we need Bayesian A/B Testing to solve academic and commercial problems?

Bayesian methodology is appealing because each time we conclude an experiment when we feel confident that a new design will provide visible improvement, we can plan the next experiment almost right away. Remember that Bayesian model is analogous to a lifelong learner who accumulates all previous data and prior distributions as knowledge. Because of this we can iterate quickly and run more experiments to test new designs effectively.

For instance, when we use Bayesian A/B Testing to test different designs, we can test them many times, or test them with a large pool of clients. We can create metrics such as 1) user engagement - time spent on the website design, 2) conversions - the number of people sign-up with the website or make purchase(s), 3) rating - the score user rates about the clarity and easiness of reading the online content, etc. If we clearly know which design we should pick after these comparisons, we become more confident that such a design will better acquire users or generate more revenues. We are more convinced that the design we pick can better achieve our business goals. Remember that the goal of doing Bayesian A/B testing can be keeping visitors on site longer and converting website visits into sign-ups, purchases, or subscriptions, that helps generate revenues.

Question 3: What are general considerations when doing Bayesian A/B testing experiments?

Cool! That's a snapshot about Bayesian A/B testing. Now let's start coding in the next video!

Video 2: Bayesian A/B Testing: Online Store Example

In this tutorial, we'll demonstrate how to use Bayesian A/B testing in an online store.

As you can see, the data is rich. There are more than 10,000 interactions of item views and orderings with 6 item tests. We name them test_a, test_b, test_c, test_d, test_e, and test_f. The dataset has 4 columns, showing that for each record,

Look at the test_assignment column. Could you imagine what are some purposes of launching 6 tests in total? I don't have the correct answer at hand. It's possible that the online retailer wants to know which online store design among the 6 alternatives leads to the best product sales in quantity. It's possible that the online retailer wants to optimize product conversion, which means the proportion of product purchase.

Question 3: How to implement Bayesian A/B Testing in the online store example?

(Concept review: the Bayesian approach models each parameter as a random variable with some probability distribution. So we can calculate probability distributions (and thus expected values) for the parameters of interest directly.)

Before conducting Bayesian A/B testing in the online store example, we need to build a research question that specifically tells what problem you want to solve, and especially, what parameter you want to infer. You should also know your baseline which means you should actually define key metrics you are working on. Here's an example.

Research Question:

Congratulations! In summary, one way we choose between two or multiple versions is by running a Bayesian A/B test. So far we have finished a full demonstration of Bayesian A/B testing to test improvement of new designs on an online store. I hope you now have a clear understanding about the general concerns when you are going to conduct Bayesian A/B testing for many different problems.

One more last minute suggestion of doing such analysis is that don't feel frustrated if your experiment does not yield a significant difference between the different variants you're actually testing. Also, it's really a nice practice that we focus on one key metric for each Bayesian A/B test. We need to keep this in mind to ensure that we're always very clear about the specific metric we want to test for improvement for every single test we design.

Video 3: Communicating Bayesian Estimation Results

Despite the increase in popularity and advocates in Bayesian estimation both in research and industrial realms, I have observed many Bayesian statistical oral and verbal reports without effective communicative language to allow non-statisticians to understand the results and implications. One possible barrier preventing the effective communication of Bayesian methods to audiences is the differences in opinions among experts on how to best conduct and interpret Bayesian analysis.

Earlier in this course, we drafted three stages of Bayesian statistical research setting according to the guidelines for Bayesian analysis compiled by the JASP research group:

Question 1: After conducting a Bayesian estimation model, how could we report the results that most people can understand?

After conducting a complete process of Bayesian A/B testing (see the last video), we first update our beliefs about which design we will pick for an online store - in this case we're likely to keep up the current online store design to prepare for future studies. We also draw our conclusions and communicate - we do not adopt a new online store design despite many new designs are tested.

Now we come back to discuss the general case of how to report clearly about the results from Bayesian estimation models. In order to boost transparency and critical assessment of statistical analysis, here I'll recommend 10 strategies to write an elaborate statistical analysis report for Bayesian estimation that includes all 1) relevant background information, 2) figures, 3) tables and 4) contextual manuscripts (cite).

List of 10 strategies:

I hope this around 10 minutes non-coding lecture can encourage you to write your first Bayesian estimation project. The final project is a student initiate project such what you can choose to write the topic that interest you the most or the most relevant to the city where you live. When you're writing you can revisit again and again to learn deeply for the recommendations and strategies of communicating results to other people, and try to take actionable thoughts aways from this lecture. And when executing and interpreting the study, don't give up when you feel frustrated during the modeling process or interpreting complex or hierarchical results. Instead, try to raise discussions with your peers - the real value of education in my perspective is having a community of people to look up and get support from, grow with each other. Being around with people who also struggle in learning coding and writing the final report and having those mutual feelings could actually become the experience that change the entire game and make learning much more doable and feasible. Good luck with your final report to finish course 2! Congratulations!

Created in deepnote.com Created in Deepnote