I am having trouble answering this question on Conditional Probabilities
Here is my current understanding:
- Conditional Probability Law: $$P(A|B) = \frac{P(A \cap B)}{P(B)}$$
Here is a visualization I thought to illustrate this concept (Python):
- Bayes Law: The Conditional Law of Probability can be re-written in a different perspective using Bayes Law
$$P(A|B) = \frac{P(A \cap B)}{P(B)} \quad \text{thus} \quad P(A \cap B) = P(A|B)P(B)$$ $$P(B|A) = \frac{P(B \cap A)}{P(A)} \quad \text{thus} \quad P(B \cap A) = P(B|A)P(A)$$ $$\text{since} \quad P(A \cap B) = P(B \cap A) \quad \text{thus} \quad P(A|B)P(B) = P(B|A)P(A)$$ $$\text{Bayes Law: } P(A|B) = \frac{P(A)P(B|A)}{P(B)} \quad \text{or} \quad P(B|A) = \frac{P(B)P(A|B)}{P(A)}$$
- Intro question: Suppose there is a rare disease that has a 1% prevalence rate. A test has a 99% chance of correctly detecting the disease for a person who has the disease and a 99% chance of rejecting a person who does not have the disease. Suppose a person tests positive - what is the probability that this person has the disease?
Answer: If prevalence rate is P(D), the probability of positive test given the disease P(T|D), and the probability of negative test given you don't have the disease P(T'|D'). The probability that a person has the disease given they tested positive, P(D|T), can be calculated using Bayes' theorem:
$$P(D|T) = \frac{P(T|D) \cdot P(D)}{P(T)}$$
The trick here is to recognize that $P(T)$ can happen two ways: The test can be positive give you have the disease $P(T|D)$ and the the test can be positive when you don't have the disease $P(T|D')$. Therefore, $P(T) = P(T|D) + P(T|D')$ :
$$P(D|T) = \frac{P(T|D) \cdot P(D)}{P(T|D) + P(T|D')}$$ $$P(D|T)= \frac{0.99 \cdot 0.01}{0.99 \cdot 0.01 + 0.01 \cdot 0.99} $$ $$= \frac{0.0099}{0.0099 + 0.0099} $$ $$= \frac{0.0099}{0.0198} $$ $$= 0.5$$
Remember $P(T|D')$ is the probability of a positive test given you don't have the disease - this is told to you in the question indirectly : 100% -1% = 99%
- Here is where I struggle: Suppose a person has 2 positive test results, what is the probability that this person actually has the disease? Here is my logic:
$$P(D | T1,T2) = \frac{P(D) * P(T1,T2 | D)}{P(T1,T2)} = \frac{P(D) * P(T2 | D) * P(T1 | D)}{P(T2,T1)} = \frac{P(D) * P(T2 | D) * P(T1 | D)}{P(D)P(T2 | D)P(T1 | D) + P(D')P(T2 | D')P(T1 | D')}$$
This relies on the fact that test 1 and test 2 are independent so $P(T1,T2 | D) = P(T2 | D) * P(T1 | D)$. Also, $P(T1,T2)$ needs to be decomposed into parts - two positive tests can happen either when a person has a disease or a person does not have the disease.
My confusion comes from the fact that this is a famous medical question where the two medical test scenario is said to use the single medical test scenario as a Bayesian update - but in the way I have done this, the two medical test scenario does not require any information from the single medical test scenario. Is it all correct?