Sub topic 14
Updating Beliefs with Bayes' Formula
Assume you know basic probability, conditional probability, and algebra. You should be comfortable reading \(P(A)\) as “the probability of event A” and \(P(A \mid B)\) as “the probability of A given that B has occurred.”
Bayes' formula updates a prior belief after receiving new evidence. In finance, it can help revise the probability of a recession after observing an economic signal, or revise the probability that an investment thesis is correct after receiving new information.
The Bayes framework
Let:
- \(A\) be the event or hypothesis being evaluated.
- \(B\) be the new evidence.
- \(P(A)\) be the prior probability of \(A\), before observing \(B\).
- \(P(B \mid A)\) be the probability of observing \(B\) when \(A\) is true.
- \(P(A \mid B)\) be the updated probability, called the posterior probability.
Bayes' formula is:
\[ P(A \mid B) = \frac{P(B \mid A)P(A)}{P(B)} \]
The denominator \(P(B)\) is the unconditional probability of the evidence. If \(A\) and its complement \(\neg A\) are the only possibilities, use the total probability rule:
\[ P(B) = P(B \mid A)P(A) + P(B \mid \neg A)P(\neg A) \]
The calculation can be viewed as a sequence:
Worked example
Suppose the prior probability that a company will default is 1%. A credit signal appears:
- \(P(A) = 0.01\)
- \(P(B \mid A) = 0.90\)
- \(P(B \mid \neg A) = 0.05\)
First calculate the total probability of the signal:
\[ P(B) = (0.90)(0.01) + (0.05)(0.99) = 0.0585 \]
Then calculate the posterior probability:
\[ P(A \mid B) = \frac{(0.90)(0.01)}{0.0585} \approx 0.1538 \]
The signal raises the default probability from 1% to about 15.38%. The posterior is still below 100% because the signal can also occur when default is not expected.
prior = 0.01
p_b_given_a = 0.90
p_b_given_not_a = 0.05
p_b = p_b_given_a * prior + p_b_given_not_a * (1 - prior)
posterior = p_b_given_a * prior / p_b
print(round(p_b, 4)) # 0.0585
print(round(posterior, 4)) # 0.1538Common errors
| Error | Correct approach |
|---|---|
| Treating \(P(B \mid A)\) as \(P(A \mid B)\) | Apply Bayes' formula; the two probabilities usually differ |
| Omitting the prior probability | Include \(P(A)\) in the numerator |
| Using only \(P(B \mid A)\) as the denominator | Calculate total \(P(B)\), including the complement |
| Ignoring the base rate | Start with the prior, even when the evidence seems persuasive |
A useful check is that the posterior must lie between 0 and 1. Strong evidence does not automatically produce a high posterior when the prior probability is very small.
Exercise
A disease affects 2% of a population. A test is positive for 95% of affected people and for 10% of unaffected people. What is the probability of disease given a positive test?
Show answer
P(positive) = (0.95)(0.02) + (0.10)(0.98) = 0.117. Therefore, P(disease | positive) = (0.95)(0.02) / 0.117 ≈ 0.1624, or 16.24%.