CPSC 502 -- Fall 2006
Assignment 4
Due: 12:30pm, Monday 30 October 2006.
Consider the domain of house plumbing represented
below.
This is a simplified model of the same domain used in the previous assignment.
In this figure, p1, p2 and p3 denote cold water
pipes. p1 is the pipe coming in from the main water
supply. t1, t2 and t3 are taps and d1, d2 and
d3 are drainage pipes. The constants shower denotes a shower,
bath denotes a bath, sink denotes a sink, and floor denotes the
floor. There can also be plugs in the sink or in the bath. You can
assume that you are in a static situation (i.e., you don't have to
worry about time); imagine that you have stumbled in this situation
and must reason about it.
Suppose you can observe or query the tap positions, flow out of drain d1, and
whether there is water in the sink and bath, and whether there is
water on the floor.
plumbing.gif
The Plumbing Domain
- What are the random variables? In particular, you need random
variables to represent the observations you may want to make, the
queries you may be interested and other (hidden) variables to keep
the model simple. For each variable, give its domain and intended
interpretation.
- Give a belief network for these variables, assuming a causal
ordering of the variables. Give reasonable conditional probability
tables. You can use the CIspace applet or any other belief network
tool.
(e.g., Netica or
Genie).
- Suppose you had to demonstrate to a skeptic that Belief networks
are appropriate for this domain. Argue that this is a reasonable
representation, and as part of your explanation, you need to give
some test cases that show what your model is capable of. Use proper
English. Be brief and concise (as this skeptic doesn't have much
time).
- What would your belief network look like if you had chosen the
opposite ordering of variables?
(a), (b) see
http://www.cs.ubc.ca/spider/poole/cs502/2006/as4/plumbing.xml
for a CIspace representation.
(d) there are many more arcs, in particular there are arcs between
nodes X and Y in the new ordering if there were arcs in the
original network or if they have common ancestors in
the original (causal) belief network that are lower in the total
ordering than both X and Y or where there are common descendents
(in the original graph) of X and Y that are also parents in the
new graph. [This is a convoluted way of using D-separation in the
original causal network to determine parents in the inverse network.]
You just need to give some examples.
Consider the belief network:
abcdef.gif
with Boolean variables (we will write A=true as a and A=false as
¬a) and the following conditional probabilities:
|
P(a) | = | 0.9 |
|
P(b) | = | 0.2 |
|
P(c|a,b) | = | 0.1 |
|
P(c|a,¬b) | = | 0.8 |
|
P(c|¬a,b) | = | 0.7 |
|
P(c|¬a,¬b) | = | 0.4
P(d| b) | = | 0.1 |
|
P(d|¬b) | = | 0.8 |
|
P(e|c) | = | 0.7 |
|
P(e|¬c) | = | 0.2 |
|
P(f|c) | = | 0.2 |
|
P(f|¬c) | = | 0.9
|
- Compute P(e) using variable elimination. Please try to do it
by hand, then check it with the CIspace applet. Do not do any
pruning. Explain the significance of each factor created (either what does it
represent or why does it have particular values).
- Compute P(e|¬f) using variable elimination. How much of
the previous computation can be reused? Show only what is different.
- Compute P(a|d) using variable elimination.
- Compute P(a | ¬f).
- Compute P(a|¬f,d).
- Explain when observing d affects your belief in a. (Be as
specific as possible.)
Here I will not give the actual tables for the factors. Use the CIspace applet to see the tables.
- To compute P(e), you can sum out D and F, and the factors
created are just 1's (that is why they can be pruned). I'll ignore
these factors.
You start off with the factors f0(A), f1(B), f2(A,B,C),
f3(C,E).
Eliminating A, you multiply f0 and f2, and sum out A, creating a factor
f4(B,C).
Eliminating B, you multiply f1 and f4, sum out B, and create
a factor f5(C).
Eliminating C, you multiply f5 and f3, sum out C, and the
resulting factor f6(E) represents P(E).
- To compute P(e|¬f), you create a factor (lets call it
f7 to avoid confusion with the previous part) f7(C).
You can prune D. Eliminating A and B acts exactly as before,
creating the same factors.
Eliminating C, you multiply f5, f3 and f7, sum out C, with the
resulting factor f8(E). To get the answer, you need to
divide each element of 8 by SUMEf8(E). This creates f9(E)
which represents P(E|¬f).
- Everything can be pruned! Or there are lots of tables with just
ones, and a constant factor. P(a|d)=P(a).
- E and D can be pruned.
- What I wanted you to notice here is that D is not irrelevant
when F is also observed.
- When C, E or F are observed and B isn't observed.
Suppose you want to compute P(f|d) in the belief network of the
previous question. You are to use this example to explain how each of
the following work. (Assume you are writing a textbook for your peers,
and are using this example to explain these concepts)
- Rejection sampling
- Importance sampling
- Particle filtering
In all of these I assume you remove E is it is irrelevant.
- Rejection sampling: Sample B, then sample D, then you can reject the sample if
the sample doesn't assign D=true. Then sample the rest of the
variables. Return the proportion of the samples where F=true.
- Importance sampling: Sample B. Weight those samples where
B=true by 0.8 and those samples with B=false by 0.8. [You can
actually do something smarter if you don't sample B by its prior,
but use a different proposal distribution.]. Then sample the other
variables. Return the weighted average of the samples with
F=true.
- Particle filtering: create lots of samples (here I will use 1000
as an example). Sample B 1000 times. Weight each sample using D
as in importance sampling. Now generate a new 1000 samples, choosing
each sample with probability proportional to its weight. Sample the
rest of the variables with these new samples, and return the
proportion of the samples where F=true.
David Poole