5
Intro to Bayesian Learning Exercise Solutions Ata Kaban The University of Birmingham

Intro to Bayesian Learning Exercise Solutions

Embed Size (px)

DESCRIPTION

Intro to Bayesian Learning Exercise Solutions. Ata Kaban The University of Birmingham. - PowerPoint PPT Presentation

Citation preview

Page 1: Intro to Bayesian Learning Exercise Solutions

Intro to Bayesian LearningExercise Solutions

Ata Kaban

The University of Birmingham

Page 2: Intro to Bayesian Learning Exercise Solutions

You are to be tested for a disease that has prevalence in the population of 1 in 1000. The lab test used is not always perfect: It has a false-positive rate of 1%. [A false-positive result is when the test is positive, although the disease is not present.] The false negative rate of the test is zero. [A false negative is when the test result is negative while in fact the disease is present.]

• a) If you are tested and you get a positive result, what is the probability that you actually have the disease?

 • b) Under the conditions in the previous question, is it more

probable that you have the disease or that you don’t?

 • c) Would the answers to a) and / or b) differ if you use a

maximum likelihood versus a maximum a posteriori hypothesis estimation method? Comment on your answer.

Page 3: Intro to Bayesian Learning Exercise Solutions

ANSWER a) We have two binary variables, A and B. A is the outcome of the test, B is the presence/absence of the disease. We need to compute P(B=1|A=1). We use Bayes theorem:

Now the required quantities are known from the problem. These are the following:

• P(A=1|B=1)=1, i.e. true positives• P(B=1)=1/1000, i.e. prevalence• P(A=1|B=0)=0.01, i.e. false positives• P(B=0)=1-1/1000

Replacing, we have:

)1()1|1()0()0|1(

)1()1|1()1|1(

BPBAPBPBAP

BPBAPABP

09099.0999.0*01.0001.0*1

001.0*1)1|1(

ABP

Page 4: Intro to Bayesian Learning Exercise Solutions

b) Under the conditions in the previous question, is it more probable that you have the disease or that you don’t?

ANSWER:

P(B=0|A=1)=1-P(B=1|A=1)=1-0.09099.

So clearly it is more probable that the disease is not present.

Page 5: Intro to Bayesian Learning Exercise Solutions

• c) Would the answers to a) and / or b) differ if you use a maximum likelihood versus a maximum a posteriori hypothesis estimation method? Comment on your answer.

ANSWER: - ML maximises P(D|h) w.r.t. h, whereas MAP maximises P(h|D).

So MAP includes prior knowledge about the hypothesis, as P(h|D) is in fact proportional to P(D|h)*P(h). This is a good example where the importance and influence of prior knowledge is evident.

- The answer at b) is based on the maximum a posteriori estimate, as we have included prior knowledge in the form of prevalence of the disease. If that would not been taken into account, i.e. both P(B=1)=0.5 and P(B=0)=0.5 is considered than the hypothesis estimate would be the maximum likelihood one. In that case the presence of the disease would come out be more probable than the absence of it. This is an example of how prior knowledge can influence the Bayesian decisions. However, more data should be collected in order to produce a more reliable estimate.