independent of the season on all previous days. The weather is either Hot (H), Rainy (R) or
Freezing (F). Given the season on any given day, the weather that day is independent of all
other variables. More formally, if we let
C
i
denote the season on the i–th day (taking values
S, M, A, W) and
O
i
denote the observed weather pattern (one of H, R, F).
We have
∀
j < i

1
, C
i
⊥
C
j

C
i

1
and
∀
X, O
i
⊥
X

C
i
where
X
is any random variable other
than
C
i
,
O
i
.
1. Draw a graphical model over
C
1
. . . C
N
, O
1
. . . O
N
that satisfies the conditional inde
pendencies listed above.
2. Implement sumproduct and maxproduct algorithms in MATLAB for this graphical
model.
3. We has made 20 observation of the weather over the last few months (i.e.,
O
1
. . . O
N
) :
{
R, F, F, H, F, H, H, H, H, H, H, H, H, R, H, H, H, R, H, H
}
Some of the values for the conditional probability table (CPT) are as follows.