Member-only story

Bayes’ Theorem, Clearly Explained with Visualization

If you tested positive with COVID, what is the chance that you actually have COVID?

Khuyen Tran
Towards Data Science
7 min readOct 15, 2021

--

Motivation

Imagine you come to the hospital to test whether you have COVID or not. You receive the bad news: you are tested positive for COVID! However, you think that there could be a chance that the result is wrong.

Image by Author

By doing some research on the internet, you know three pieces of information:

  • the probability that a person has a positive test result given that person is healthy is 0.01
  • the probability that a patient has a positive test result given that person has COVID is 0.98
  • the probability that a patient has COVID is 0.01.

Note: These numbers are not real and are made up for teaching purposes.

What is the probability that a patient has COVID if that person tested positive for COVID?

The test seem to have high accuracy. After being tested positive, the probability that you have COVID should be high, right?

Before settling down with that guess, let’s use Bayes’ theorem to answer this question.

What is Bayes’ Theorem?

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

Responses (3)