patterns of inference - medical diagnosis - lung disease
Closed this issue · 0 comments
In patterns of inference, on the example Medical Diagnosis halfway down the page this is stated:
"To illustrate, observe how the probabilities of cold and lungDisease change when we observe cough is true:"
followed by:
"Both cold and lung disease are now far more likely that their baseline probability: the probability of having a cold increases from 2% to around 50%; the probability of having lung disease also increases from 1 in a 1000 to around 50%."
This seemed wrong to me immediately, considering the code is:
var cough = (cold && flip(0.5)) || (lungDisease && flip(0.5)) || flip(0.001);
lung disease and cold should have about the same prior probability.
the actual code looks like this:
var smokes = flip(.2);
var lungDisease = flip(0.001) || (smokes && flip(0.1));
var cold = flip(0.02);
which means lung disease is 2.1% given you know nothing about the patient or, expressed similarly, 21 in 1000 to around 50%