“Are COVID-19 tests accurate? Let’s ask Thomas Bayes”, Nir Regev

Introduction:

In the midst of the COVID-19 pandemic, accurate testing plays a pivotal role in controlling the spread of the virus and making informed decisions. However, interpreting test results is not always straightforward, as it depends on various factors such as the prevalence of the disease in the population and the characteristics of the test itself. In this blog post, we will delve into a probabilistic approach to analyze the reliability of COVID-19 test results using Bayes' Rule and complement our analysis with a Python simulation.

Problem Statement:

Consider a city experiencing a new outbreak of COVID-19. The health department estimates that, at this moment, 1% of the city's population is infected with the virus. A pharmaceutical company has developed a new COVID-19 test with a sensitivity (true positive rate) of 95% and a specificity (true negative rate) of 98%. Sensitivity is the probability that the test correctly identifies an infected person as positive, while specificity is the probability that the test correctly identifies a non-infected person as negative.

Our objectives are to determine:

  1. The probability that a person who tests positive is actually infected with the virus.
  2. The probability that a person who tests negative is actually not infected with the virus.

Solution:

To tackle this problem, we will employ Bayes' Rule, a fundamental principle in probability theory that allows us to update our beliefs based on new evidence. Let's define the following events:

Given:

Using Bayes' Rule, we aim to calculate: