Tutorial 1: Solution - Imperial College...

1
Tutorial 1: Solution 1. An image is processed, and the following data extracted: [s 1 ,d 2 ,f 3 ]. Calculate the λ evidence that is propa- gated and the probability distributions over C . λ(e 1 )= P (s 1 |e 1 )P (d 2 |e 1 )=0 λ(e 2 )= P (s 1 |e 2 )P (d 2 |e 2 )=0.33 × 0.33 = 0.11 λ(e 3 )= P (s 1 |e 3 )P (d 2 |e 3 )=0.14 × 0.14 = 0.02 and to propagate to C we need the conditioning equation λ(c 1 ) = (0 + 0.11P (e 2 |c 1 )+0.02P (e 3 |c 1 )) × P (f 3 |c 1 ) = (0.11 × 0.25 + 0.02 × 0.25)0.125 = .004 λ(c 2 ) = (0 + 0.11P (e 2 |c 2 )+0.02P (e 3 |c 2 )) × P (f 3 |c 2 ) = (0.11 × 0.14 + 0.02 × 0.72)0.14 = .0042 Normalising over the evidence we have that P 0 (C ) = [0.488, 0.512] suggesting that the image is not a cat, but with no great certainty. (NB since the prior probabilities for c 1 and c 2 are the same we don’t need to bother with them. 2. The same image is processed in monochrome. Thus there is no information for F . Re-calculate the proba- bilities of C . Since there is no evidence from F , using the conditioning equation gives us that: λ F (c 1 )= λ F (c 2 )=1 in other words we just consider the λ evidence from E. For: [s 1 ,d 2 ] λ(c 1 ) = (0 + 0.11P (e 2 |c 1 )+0.02P (e 3 |c 1 )) = (0.11 × 0.25 + 0.02 × 0.25) = .0325 λ(c 2 ) = (0 + 0.11P (e 2 |c 2 )+0.02P (e 3 |c 2 )) = (0.11 × 0.14 + 0.02 × 0.72) = .0298 This time the network just favours the cat. 3. Doubt is expressed about the accuracy of the computer vision algorithms. Thus instead S and D are instan- tiated with virtual evidence. There is still no information for node F . Re-calculate the distributions over E and C . This time its the evidence for E that changes. λ(e 1 ) = (0.8 × P (s 1 |e 1 )+0.2 × P (s 2 |e 1 ) × (0.3 × P (d 1 |e 1 )+0.4 × P (d 2 |e 1 )+0.3 × P (d 3 |e 1 )) = (0 + 0.2 × 0.6) × (0.3 × 0.4+0.4 × 0.4+0.2 × 0.3) = 0.12 × 0.34 = 0.041 λ(e 2 ) = (0.8 × P (s 1 |e 2 )+0.2 × P (s 2 |e 2 ) × (0.3 × P (d 1 |e 2 )+0.4 × P (d 2 |e 2 )+0.3 × P (d 3 |e 2 )) = (0.8 × 0.33 + 0) × (0.3 × 0.33 + 0.4 × 0.33 + 0.3 × 0.34) = 0.264 × 0.33 = 0.087 λ(e 3 ) = (0.8 × P (s 1 |e 3 )+0.2 × P (s 2 |e 3 ) × (0.3 × P (d 1 |e 3 )+0.4 × P (d 2 |e 3 )+0.3 × P (d 3 |e 3 )) = (0.8 × 0.14 + 0.2 × .14) × (0.3 × 0.29 + 0.4 × 0.14 + 0.3 × 0.14) = 0.0259 since there is no evidence from F this is all that we need to propagate to C . λ(c 1 ) = (0.041P (e1|c 1 )+0.087P (e 2 |c 1 )+0.0259P (e 3 |c 1 )) = (0.041 × 0.5+0.087 × 0.25 + 0.0259 × 0.25) = .049 λ(c 2 ) = (0.041P (e1|c 2 )+0.087P (e 2 |c 2 )+0.0259P (e 3 |c 2 )) = (0.041 × 0.14 + 0.087 × 0.14 + 0.0259 × 0.72) = .037 Normalising now gives us P (C ) = [0.57, 0.43] 4. Given the evidence for C in part 3, calculate the probability distribution over F . P(C) does not contain any evidence from F , so: π(F )= 0 0.3 0.125 0 0.125 0.14 0.25 0.14 0.125 0 0.125 0 0 0.14 0.125 0.14 0 0.14 0.125 0 0.57 0.43 = 0.129 0.071 0.131 0.203 0.071 0.071 0.060 0.131 0.060 0.071 The result does not need to be normalised in this particular example. DOC493: Intelligent Data Analysis and Probabilistic Inference Tutorial 1 3

Transcript of Tutorial 1: Solution - Imperial College...

Tutorial 1: Solution

1. An image is processed, and the following data extracted: [s1, d2, f3]. Calculate the λ evidence that is propa-gated and the probability distributions over C.

λ(e1) = P (s1|e1)P (d2|e1) = 0λ(e2) = P (s1|e2)P (d2|e2) = 0.33× 0.33 = 0.11λ(e3) = P (s1|e3)P (d2|e3) = 0.14× 0.14 = 0.02and to propagate to C we need the conditioning equationλ(c1) = (0 + 0.11P (e2|c1) + 0.02P (e3|c1))× P (f3|c1) = (0.11× 0.25 + 0.02× 0.25)0.125 = .004λ(c2) = (0 + 0.11P (e2|c2) + 0.02P (e3|c2))× P (f3|c2) = (0.11× 0.14 + 0.02× 0.72)0.14 = .0042Normalising over the evidence we have that P ′(C) = [0.488, 0.512] suggesting that the image is not a cat, butwith no great certainty. (NB since the prior probabilities for c1 and c2 are the same we don’t need to botherwith them.

2. The same image is processed in monochrome. Thus there is no information for F . Re-calculate the proba-bilities of C.

Since there is no evidence from F , using the conditioning equation gives us that: λF (c1) = λF (c2) = 1 inother words we just consider the λ evidence from E. For: [s1, d2]λ(c1) = (0 + 0.11P (e2|c1) + 0.02P (e3|c1)) = (0.11× 0.25 + 0.02× 0.25) = .0325λ(c2) = (0 + 0.11P (e2|c2) + 0.02P (e3|c2)) = (0.11× 0.14 + 0.02× 0.72) = .0298This time the network just favours the cat.

3. Doubt is expressed about the accuracy of the computer vision algorithms. Thus instead S and D are instan-tiated with virtual evidence. There is still no information for node F . Re-calculate the distributions over E andC.

This time its the evidence for E that changes.λ(e1) = (0.8× P (s1|e1) + 0.2× P (s2|e1)× (0.3× P (d1|e1) + 0.4× P (d2|e1) + 0.3× P (d3|e1))

= (0 + 0.2× 0.6)× (0.3× 0.4 + 0.4× 0.4 + 0.2× 0.3) = 0.12× 0.34 = 0.041λ(e2) = (0.8× P (s1|e2) + 0.2× P (s2|e2)× (0.3× P (d1|e2) + 0.4× P (d2|e2) + 0.3× P (d3|e2))

= (0.8× 0.33 + 0)× (0.3× 0.33 + 0.4× 0.33 + 0.3× 0.34) = 0.264× 0.33 = 0.087λ(e3) = (0.8× P (s1|e3) + 0.2× P (s2|e3)× (0.3× P (d1|e3) + 0.4× P (d2|e3) + 0.3× P (d3|e3))

= (0.8× 0.14 + 0.2× .14)× (0.3× 0.29 + 0.4× 0.14 + 0.3× 0.14) = 0.0259since there is no evidence from F this is all that we need to propagate to C.λ(c1) = (0.041P (e1|c1) + 0.087P (e2|c1) + 0.0259P (e3|c1)) = (0.041× 0.5 + 0.087× 0.25 + 0.0259× 0.25) = .049

λ(c2) = (0.041P (e1|c2)+ 0.087P (e2|c2)+ 0.0259P (e3|c2)) = (0.041× 0.14+ 0.087× 0.14+ 0.0259× 0.72) = .037

Normalising now gives us P (C) = [0.57, 0.43]

4. Given the evidence for C in part 3, calculate the probability distribution over F .

P(C) does not contain any evidence from F , so:

π(F ) =

0 0.30.125 00.125 0.140.25 0.140.125 00.125 00 0.14

0.125 0.140 0.14

0.125 0

[0.570.43

]=

0.1290.0710.1310.2030.0710.0710.0600.1310.0600.071

The result does not need to be normalised in this particular example.

DOC493: Intelligent Data Analysis and Probabilistic Inference Tutorial 1 3