Some test examples

These are some examples to test how the library works. They reproduce the Bayesian Network of the Korb’s book, Bayesian artificial intelligence, about lung cancer (p. 30).

This is the saying of the problem:

A patient has been suffering from shoteness of breath (called dyspnoea) and visits the doctor, worried that he has lung cancer. The doctor knows that other diseases, such as tuberculosis and bronchitis, are possible causes, as well as lung cancer. She also knows that other relevant information includes whether or not the patient  is a smoker (increasing the chances of cancer and bronchitis) and what sort of air pollution he has been exposed to. A positive X-ray would indicate either tuberculosis or lung cancer.

Bayesian networks perform different kind of inferences, which can be reproduced using syllogims. Next, there are three example files for three different inferences:

As we said, SEREA also can deal with quantifiers that are not defined as trapezoidal functions or with non-normalized results. So, let us consider the following example using :

In a wine warehouse that sells red, white wine and other products derived from grapes, we have the following sentences:

Q bottles of red wine are sold in the United Kingdom.
Q bottles of red wine sold in the United Kingdom are bought by J. Moriarty.

Next, the files for executing the inference and the graphical representation of the quantifier of the conclusion:

Graphic representation: wine

 

These is the example of a Bayesian network conveying a problem about lung cancer diagnosis:

lungcancer

Next, we formulate four questions that can be solved using fuzzy syllogisms with the corresponding syllogisms that can be solved by SEREA:

  1. What is the probability of having lung cancer? LungCancer_Q1
  2. What is the probability of having cancer given the patient is smoker? LungCancer_Q2
  3. What is the probability of having dyspnoea given the patient is smoker? LungCancer_Q3
  4. What is the probability of living in high pollution areas given the patient have dyspnoea? LungCancer_Q4

This is the syllogism corresponding to the Sally’s case, one of the most famous misapplications of Bayesian reasoning.