Bayes' Theorem
Get introduced to the concept of Bayes' Theorem and calculate the posterior probability.
We'll cover the following
Bayes’ Theorem describes a way of finding a conditional probability when we know certain other probabilities. The following equation mathematically denotes Bayes’ Theorem:
Bayes’ Theorem says we can calculate the posterior probability from a prior probability and some evidence-related modifier.
The posterior denotes what we believe about the after gathering the new information about the . It is a conditional probability such as we discussed above. The prior probability denotes what we believed about before we gathered the new information. It is the overall probability of our .
The modifier of the new information denotes the relative change of our belief about caused by the .
This modifier is the quotient of the backward probability () and the probability of the new piece of information () The backward probability, which is the numerator of the modifier, answers the question of what the probability of observing this evidence in a world where our hypothesis could be true. The denominator is the probability of observing the evidence on its own.
When we see the evidence often in a world where the hypothesis is true but rarely on its own, it seems to support the hypothesis. On the contrary, if we see the evidence everywhere but don’t see it in a world where the hypothesis is true, then the evidence opposes the hypothesis.
The farther the modifier is away from 1
, the more it changes the probability. A modifier of precisely 1
would not change the probability at all. Let’s define the value of the informativeness as the modifier’s distance to 1
.
If we have one hypothesis and multiple pieces of evidence ,…, , then we have modifiers :
What does that mean in practice?
Our is a passenger who survived the Titanic shipwreck. We have two pieces of evidence and .
- is the overall probability of a passenger surviving.
- is the probability of a passenger to be female,
- and is the probability of a passenger holding a second-class ticket.
- denotes how likely a passenger who survived is female.
- And denotes how likely a passenger who survived had a second-class ticket.
The following equation depicts how to calculate the probability of a female passenger with a second class ticket to survive:
Let’s have a look at the Python code.
Get hands-on with 1200+ tech skills courses.