Exercise 2: Epidemiology

Imagine that you are an epidemiologist and you are determining people’s cause of death. In this simplified world, there are two main diseases, cancer and the common cold. People rarely have cancer, , but when they do have cancer, it is often fatal, . People are much more likely to have a common cold, , but it is rarely fatal, . Very rarely, people also die of other causes .

Write this model in WebPPL and use Infer to answer these questions (Be sure to include your code in your answer):

Infer({method: 'enumerate'}, function() {
...
});

a) Compute and . How do these probabilities compare to and ? Using these probabilities, give an example of explaining away.

b) Compute and . How do these probabilities compare to and ? Using these probabilities, give an example of explaining away.