Bayes teorem
Bayes teorem
This is bluntly copied from https://www.freecodecamp.org/news/bayes-rule-explained/ to keep the information locally
The equation itself is not too complex:

There are four parts:
- Posterior probability (updated probability after the evidence is considered)
- Prior probability (the probability before the evidence is considered)
- Likelihood (probability of the evidence, given the belief is true)
- Marginal probability (probability of the evidence, under any circumstance)
Worked example of Bayes' Rule
Here's a simple worked example.
Your neighbour is watching their favourite football (or soccer) team. You hear them cheering, and want to estimate the probability their team has scored.
Step 1 – write down the posterior probability of a goal, given cheering
Step 2 – estimate the prior probability of a goal as 2%
Step 3 – estimate the likelihood probability of cheering, given there's a goal as 90% (perhaps your neighbour won't celebrate if their team is losing badly)
Step 4 – estimate the marginal probability of cheering – this could be because:
- a goal has been scored (2% of the time, times 90% probability)
- or any other reason, such as the other team missing a penalty or having a player sent off (98% of the time, times perhaps 1% probability)
Now, piece everything together:
