Trustworthy Online Controlled Experiments: … you got my attention

Just yesterday, I shared about a popular science book about Bayes. Today I started a new one, called Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. I picked it because I want to learn more about the industry standard way of doing controlled experiments, an area where I have some experience. This particular book started well.

Even the first chapters show that the authors do have experience I can relate to and can, hopefully, learn from.

This quote, for example, is included in their preface:

Any figure that looks interesting or different is usually wrong

— Twyman’s Law

It matches my experience with overly positive results or ambitious claims in analysis. Can’t tell you how many times I’ve fallen into the trap of believing something wins big time while there was really just a mistake, or a bias of some kind, twisting the results. But I had no clue someone postulated a law on it and got a Wikipedia page about it. I can now cite it and gain mana points 😀

So, I have a good feeling about this book and I hope to be able to complete it much faster than the last one. It just starts well.

Unfortunately, my copy arrived with significant damage. It was improperly packaged and delivered poorly. However, it is a book I read with a pen, underlining what I think is important, and leaving notes inside, so it will not get any better anyway.

Everything Is Predictable: How Bayes’ Remarkable Theorem Explains the World, Book Review

I’m interested in improving my understanding of experimentation. As a person, educated in frequentist statistics, I wanted to learn more about the Bayesian approach, so I got myself a bunch of related books with an increasing level of difficulty to read (more and more formulas).

This is the first one of the batch, which is popular science. It’s tells the story of Bayes and his approach to decision making based on updating probabilities. The amount of useful content inside is roughly comparable to 2-3 popular science Youtube videos of the type I like watching.

The book shared some useful stories and examples, the backstory, and some context about the theorem and its use. However, once I got some of that, it started repeating, nearing unreadability towards the end.

Do I regret reading it? No, I think it cracked some doors open for me and it will help me understand the matter better once I get into the textbooks. So, while I wouldn’t give it a 5*, I think it’s a solid 4*/5 and worth the time and money, as long as you dedicate time for it and read it in 2-3 days, not in 1+ months, which is what I did.

Reverend Bayes

Thomas Bayes was an 18th century minister, the fruit of whose work I currently study.

Bayes was curious about probabilities, which in the 1700s primarily meant things like predicting dice rolls, coin flips, and the position of billiard balls. We don’t flip coins very often so here’s a more modern example that can be used to understand his line of study.

A Covid test says that you have Covid. The test is 95% accurate and would sometimes yield a false positive, telling that you have Covid while in reality, you don’t, measured during the pandemic. It’s 2026 and you’re positive. Do you really have Covid? Intuitively, you say “Yes, 95% chance is a lot”. But if you test the 1700 population England with the same test, 5.5 million people in total, you’d get 275000 false positives (or less, assuming part of the accuracy issues are false negatives). We tested 1700 England and declared a Covid pandemic 300 years before it happened.

The missing piece, according to Bayes, is the prior probability: how likely it was that you had Covid before taking the test. If Covid is very common, a positive result strongly suggests that you are infected. However, if Covid is rare and only a small fraction of the population is infected, even a highly accurate test can produce enough false positives that a positive result may be meaningless and using even a very accurate test is counter-productive.

So, Thomas Bayes came up with the following theorem:

P(A|B)=P(B|A)P(A)P(B)P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}

The probability of a hypothesis given some evidence equals the likelihood of observing that evidence if the hypothesis were true, multiplied by the prior belief in the hypothesis, and divided by the overall probability of observing the evidence. In practice, it provides a formal way of answering the question: “Given what I already believed, how much should this new information change my mind?

Bayes’ theorem combines the test accuracy with the prior likelihood of infection to estimate the actual probability that you have Covid.

That thinking is wonderful, and it created a cult following, very strong in the line of Software Engineering. However, it’s not unambiguous, and not universally applicable. Imagine I’m polling for two presidential candidates. I want to guess who will win based on the data we have, let’s say, 1000 interviews across the country. Where’s my prior knowledge? How do I fit in Bayes into that?

I studied Stats from 9th to 12th grade in high school, we had statistics every semester. Then I studied it during my bachelors, together with a separate exam in probability. That was awhile back but I remember enough that my teachers were frequentists, their approach in inference revolved around the null hypothesis and the normal distribution – you’d define a hypothesis you wanted to disprove, collect data, and calculate a p-value to decide whether the evidence was strong enough to reject it. The underlying assumption was that probability meant the long-run frequency of an event across many repeated trials, not a degree of belief. The alternative approach to look into it, introduced by Thomas Bayes was not a highlight, leaving a gap in both my knowledge, and my intuitive understanding of data, which I’m trying to fill.

Okay, so why I’m writing all of this? Because it’s in my mind. Making sense of data seems to be significantly harder than the surface level analysis. I want to improve my understanding and have acquired a collection of books on the subject. Currently reading Everything Is Predictable: How Bayes’ Remarkable Theorem Explains the World. It’s a popular science book, not a school book, but I think it’s a good introduction to this idea before looking into more complicated math. Wish me luck.