This document discusses Hidden Markov Models (HMM). It explains that HMMs can be used to predict weather conditions on an alien planet based on emoji data received, when the planet's light detector fails. The document outlines how to determine transition and emission probabilities based on past data, and use these probabilities to calculate likelihoods and predict weather patterns given a sequence of emoji observations. Examples are provided to illustrate how to apply the HMM to predict weather for 1, 2, and 3 day sequences of emoji data.
5. Transition Probability Matrix
0.6 1.00.4
0.3 0.00.5
0.1 0.00.1
FROMTO
Home
Office
Bank
Home Office Bank
1.0
0.0
0.0
Transition Probability Matrix Starting
Probability
Vector
0.4
0.5
0.1
Prediction
for next
event
6. Transition Probability Matrix
0.6 1.00.4
0.3 0.00.5
0.1 0.00.1
FROMTO
Home
Office
Bank
Home Office Bank
1.0
0.0
0.0
Transition Probability Matrix Starting
Probability
Vector
0.56
0.35
0.09
Prediction
after 2nd
event
2
7. Transition Probability Matrix
0.6 1.00.4
0.3 0.00.5
0.1 0.00.1
FROMTO
Home
Office
Bank
Home Office Bank
1.0
0.0
0.0
Transition Probability Matrix Starting
Probability
Vector
0.53
0.37
0.09
Prediction
for 20
event
20
8. Suppose winter weather on alien planet
Sunny Rainy
Happy
Sad
● If Alien planet filters less light of it’s
star, it means no clouds are there on
the planet and our alien friend will
send us a happy emoji.
● Sometimes, very rarely, we receive a
sad emoji while our data telling us
the weather is sunny.
● If alien planet filters more light of it’s
star, it means the weather is cloudy
and our alien friend will send us sad
emoji.
● Sometimes, we recieve a happy emoji
too while our data telling us the
weather is cloudy.Sad
Happy
0.8 0.6
0.2 0.4
9. The last emojis we received are
One fine morning, our
light detector fails but
we are receiving
emojis from our alien
friend and we need to
predict weather on the
alien planet based on
those emojis
M
T
W
T
10. Hidden Markov Model of Situation
Sunny Rainy
0.8 0.6
0.2 0.4
0.8
0.4
0.2
0.6
Happy
Sad
Sad Happy
11. Types of states
Sunny Rainy
Happy Sad
Hidden States that
we cannot observe
directly.
Observational States
that we can observe
directly.
14. Questions to Ask
● How did we find these probabilities?
● What is the probability that a random day is sunny or
rainy?
● If we receive a happy emoji today, what is the probability
that it’s sunny or rainy
● If for three days we receive the emojis Happy, Sad,
Happy what was the weather on alien’s planet?
15. How did we find the Transition probabilities?
From the previous data when out light detector was working fine, we had the following observations
Probability of next day if a day is sunny. Probability of next day if a day is rainy.
8 (0.8)
2 (0.2)
2 (0.4)
3 (0.6)
16. How did we find the Emission probabilities?
From the previous data when out light detector was working fine, we had the following observations
Probability of emoji if a day is sunny. Probability of emoji if a day is rainy.
8 (0.8)
2 (0.2)
2 (0.4)
3 (0.6)
17. All the probabilities have been calculated
Sunny Rainy
0.8 0.6
0.2 0.4
0.8
0.4
0.2
0.6
Happy
Sad
Sad Happy
18. What is the probability that a random day is sunny or rainy?
S
0.8
0.4
0.2
0.6
R
S = 0.8S + 0.4R R = 0.2S + 0.6RS + R = 1
Solving Systems of Equations, We get S = 2/3 R = 1/3
19. P( | ) = 0.8
P( )= ⅔ &
P( | ) = 0.2
If we receive a happy emoji today, what is the probability that
it’s sunny or rainy?
Probability that a day is sunny. Probability that a day is rainy.
By Bayes Theorem, If we received
P(A|B) =P(A) P(B|A)
P(B)
P( )= ⅔
P( | ) = 0.8
P( | ) = 0.4
P( )= ⅓ & P( )= ⅔
20. If for three days we receive the emojis Happy, Sad, Happy
what was the weather on alien’s planet?
If Happy, weather
can be
If Sad, weather
can be
Sunny Sunny RainyRainy
21. If Happy, Sad what was the weather on alien’s planet?
If Happy, Sad we will have the following 4 cases, we will check the
probability for each case and pick the one with the highest probability.
23. Happy, Sad, Happy what was the weather on alien’s planet?
If Happy, Sad, Happy we will have the 8 cases, we will check the
probability for each case and pick the one with the highest probability.
25. Happy, Sad, Happy We will check for sunny, sunny case,
because it has the highest probability in previous case.
0.8
0.67 0.8
0.2
0.00686
0.4
0.2
26. Happy, Sad, Happy We will check for sunny, sunny case,
because it has the highest probability in previous case.
0.8
0.67 0.8
0.2
0.05488
0.8
0.8
27. Optimization
Instead of checking all the cases that will be 2^n , we will only traverse the most
optimal path to reach the destination and prune the other branches of tree.