SP-Fall2013-HW7.pdf

In the name of GOD.
Sharif University of Technology
Stochastic Processes CE 695 Dr. H.R. Rabiee
Homework 7 (Hidden Markov Models)
deadline: Dey 14th
1. Three boxes each contain the number of black and white marbles indicated in the table below 1. Five marbles are selected by selecting a box
at random and then selecting a marble at random from that box with
immediate replacement.
Figure 1: Balles in each boxes, problem 1
(a) Assume the boxes selected are hidden. Formulate an HMM which
models the above process for selecting marbles, i.e. determine λ =
(π, A, B). Use 1 to represent black and 2 to represent white marbles.
(b) Compute the probability of observing the marble color sequence O =
(1, 1, 2, 2, 1) if the hidden sequence of boxes selected is Q = (1, 1, 3, 3, 2).
(c) If the marble color sequence is O = (1, 1, 2, 2, 1), determine the most
likely sequence of boxes selected, Q∗ . Explain how you obtained your
answer. Hint: The fact that each of the hidden states are equally
likely to have been selected at each step makes this an easy problem.
(d) Given the marble color sequence O = (1, 1, 2, 2, 1), show that the
answer to part (c), Q∗ , is more likely than Q = (1, 1, 3, 3, 2) from
∗
|O,λ)
part (b) by computing a log-odds ratio. Hint: Compute ln PP(Q
(Q|O,λ) .
You do not need to compute P (O|λ).
(e) Find the period of each essential state. Verify that essential states
that blong to the same comunicating class have the same period.
(f) Compute P (O|λ). Hint: Use the Law of Total Probability. You will
need five for loops to add all the terms.
2. Suppose you were locked in a room for several days, and you were asked
about the weather outside. The only piece of evidence you have is whether
the person who comes into the room carrying your daily meal is carrying
an umbrella or not. Let’s suppose the probabilities of figures 2 and 3.
Suppose the day you were locked in it was sunny. The next day, the
caretaker carried an umbrella into the room. Assuming that the prior
probability of the caretaker carrying an umbrella on any day is 0.5, what’s
the probability that the second day was rainy?
1
Figure 2: Transition probabilities of problem 2
Figure 3: Observation probabilities of problem 2
3. In problem 2, suppose the day you were locked in the room it was sunny;
the caretaker brought in an umbrella on day 2, but not on day 3. Again
assuming that the prior probability of the caretaker bringing an umbrella
is 0.5, what’s the probability that it’s foggy on day 3?
4. In each of the following items, is HMM a suitable tool for modeling the
data? If it is suitable, determine observations and probable latent variables
in each step:
(a) Weather conditions data (temperature, ...) in days of a year.
(b) Instances of hand-writen digits which are observed by a light pen.
(c) Stocks price of companies in a day.
(d) The stream of transactions of a bank which may be fraudulent or
not.
2