COVID-19 TEST AND BAYES THEOREM

Home > LearnHub > Covid and Bayes Theorem

BY THOMAS ZHANG

JULY 1, 2023, PRINCETON

In December 2021, a classmate of mine suddenly developed a fever. After taking a COVID-19 test, the result came back positive. I reassured him that based on the principles of the testing kit, this result doesn’t necessarily prove he is infected with the virus as the accuracy of the test itself is not 100%. The positive result only indicates the probability of the test showing positive if my classmate is truly positive (actually infected with the virus). However, what we want to know is the reverse: given a positive test result, what is the probability that my classmate is truly positive?

 

A couple of months later, I decided to approach this problem mathematically. Here’s how I framed it:

At first, we found a report from the Institute for Health Metrics and Evaluation, which indicated that in December 2021, the proportion of positive test results within the United States was 34%. (source: figure 8.1, 102_briefing_United_States_of_America_43.pdf  Click here to download) Therefore, we can estimate P(B) as 34%.

Next, we learned from Wikipedia that an estimated 120 million people in the United States were infected with COVID-19 in 2021. (source: COVID-19 pandemic in the United States - Wikipedia) Using this information, we estimated P(A) as 36%.

Additionally, we discovered that when a COVID-19 test shows a positive result, the true probability of being infected with the virus is 80%. (source: Rachael Zimlich, How Accurate Are At-Home COVID-19 Tests? ) Thus, we know P(B|A) is 80%.

Applying Bayes’ theorem, we can calculate the result for P(A|B):

P(A|B) = P(A) * P(B|A)/P(B) = 36%* 80%/34% = 85%

Through this example, I recognize that Bayes’ theorem, seemingly simple, holds immense power—it allows us to infer the future based on the present. In modern science, we encounter the presence of Bayes’ formula everywhere: from medical diagnoses and marketing decisions to financial investments and the significant impact of artificial intelligence in recent years.

However, tracing the history of this magical formula, we find an intriguing story. Thomas Bayes (1702–1763), an English theologian, mathematician, philosopher, and statistician, is the founder of probability theory and the creator of Bayesian statistics. He applied mathematical probability “inductively,” reasoning from specific to general, from samples to the entire population.

Yet, Bayes’ theorem was not published during his lifetime. If not for his close friend Richard Price, this remarkable formula might have remained buried in the dust of history.

After Bayes died in 1761, Price meticulously examined all of Bayes’ manuscripts to determine if anything was worth publishing. 1763, Price discovered this formula in one of Bayes’ papers and published it. (source: 2018, Stephen M. Stigler, https://doi.org/10.1214/17-STS635)

Interestingly, Price’s interest in the formula was not purely mathematical; it arose from a debate he had with Hume about God. In 1748, philosopher David Hume published “Of Miracles.” Hume argued that when someone claims to have witnessed a miracle, it does not necessarily prove that the miracle indeed occurred because it contradicts our everyday observations.

As a believer in the miracle of Jesus’s resurrection, Price took exception. He believed Bayes’ formula proved it wrong. In a 1767 essay, Price shows that even if a person observes that the tide has come in a million times, on statistical grounds they cannot reasonably say it will never stop coming in. Using Bayes’ theorem, based on those million observations, Price calculated that there is a 50% chance the true probability of the tide not coming in one day is somewhere between 1 in 600,000 and 1 in 3 million. Therefore, he argued, it is not possible to eliminate the chance of a miracle based on a large number of negative observations.

🙋  MORE FOR YOU