SlideShare a Scribd company logo
1 of 14
Markov Models
ALI A. JALIL
Introduction
 Weather prediction is all about trying to guess what the weather will be like
tomorrow based on a history of observations of weather
 Let us assume a simplified model of weather prediction
 we’ll collect statistics on what the weather was like today based on what the
weather was like yesterday the day before and so forth
 We want to collect the following probabilities:
Introduction
 Using above expression we can give probabilities of types of weather for
tomorrow and the next day using n days of history
 For example if we knew that the weather for the past three days was (sunny, sunny
foggy) in chronological order the probability that tomorrow would be rainy is
given by:
 Here is the problem, the larger n is the more statistics we must collect, Suppose
that n=5 then we must collect statistics for 243 past histories
Markov Models
 Therefore we will make a simplifying assumption called the Markov Assumption:
 This is called a first order Markov assumption since we say that the probability of an
observation at time n only depends on the observation at time n-1
 A second order Markov assumption would have the observation at time n depend on
n-1 and n-2.
Markov Models
 We can the express the joint probability using the Markov assumption:
 So this now has a profound affect on the number of histories that we have to
find statistics for.
 we now only need 32 =9 numbers to characterize the probabilities of all of the
sequences.
Markov Model
 Example:
Markov Model – Example
 Q: Given that today is sunny what is the probability that tomorrow is sunny and
the day after is rainy?,
 A: Well this translates into:
Markov Model – Example
 Q: Given that today is foggy what is the probability that it will be rainy two days
from now?
 A: There are three ways to get from foggy today to rainy two days from now
(foggy, foggy, rainy), (foggy, rainy, rainy) and (foggy, sunny, rainy) Therefore we
have to sum over these paths
Hidden Markov Model
 Well 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 that your caretaker carries an umbrella
is 0.1 if the weather is sunny, 0.8 if it is actually raining, and 0.3 if it is
foggy.
Hidden Markov Model
 The equation for the weather Markov process before you were locked in the
room was:
 However, the actual weather is hidden from you.
 Finding the probability of a certain weather qi ∈ {Sunny ,foggy, Cloudy } can
only be based on the observation xi, with xi= ☂️ , if your caretaker brought an
umbrella on day i
 and xi = 🌂 if the caretaker did not bring an umbrella.
Hidden Markov Model
 This conditional probability P(qi|xi) can be rewritten according to Bayes’ rule:
 or, for n days, and weather sequence Q = {q1, . . . , qn}, as well as ‘umbrella
sequence’ X = {x1, , . . . , xn}
 using the probability P(q1, . . . , qn) of a Markov weather sequence from above,
and the probability P(x1, . . . , xn) of seeing a particular sequence of umbrella
events (e.g., {☂️ , 🌂 , ☂️ }). The probability P(x1, . . . ,xn|q1,.. .,qn) can be
estimated as if you assume that, for all i, the qi, xi are
independent of all xj and qj , for all j ≠ i.
Hidden Markov Model
 We want to draw conclusions from our observations (if the persons carries an
umbrella or not) about the weather outside.
Hidden Markov Model - Example
 Q: Suppose the day you were locked in it was sunny. The next day, the caretaker
carried an umbrella into the room. You would like to know, what the weather was like
on this second day.
 A: First we calculate the likelihood for the second day to be sunny:
p(q2 =Sunny|q1 = Sunny, x2 = ☂️) =
p(x2 = ☂️ |q2 =Sunny ) * P(q2 = Sunny|q1 =Sunny ) = 0.1* 0.8 = 0.08
 then for the second day to be rainy:
p(q2 =rainy|q1 =sunny, x2 = ☂️) =
P(x2 = ☂️ |q2 = rainy) * P(q2 = ☂️ |q1 =sunny)= 0.8 * 0.05 = 0.04
 and finally for the second day to be foggy:
p(q2 = |q1 = , x2 = ) = P(x2 = |q2 = ) * P(q2 = |q1 = )= 0.3 *0.15 = 0.045
 Thus, although the caretaker did carry an umbrella, it is most likely that on the second
day the weather was sunny.
Thank You

More Related Content

What's hot

Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbingHema Kashyap
 
Lecture 7: Hidden Markov Models (HMMs)
Lecture 7: Hidden Markov Models (HMMs)Lecture 7: Hidden Markov Models (HMMs)
Lecture 7: Hidden Markov Models (HMMs)Marina Santini
 
Reinforcement learning
Reinforcement  learningReinforcement  learning
Reinforcement learningSKS
 
Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]
Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]
Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]Shakeeb Ahmad Mohammad Mukhtar
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in folchandsek666
 
Hidden Markov Models
Hidden Markov ModelsHidden Markov Models
Hidden Markov ModelsVu Pham
 
Reinforcement learning 7313
Reinforcement learning 7313Reinforcement learning 7313
Reinforcement learning 7313Slideshare
 
Pattern recognition binoy 05-naive bayes classifier
Pattern recognition binoy 05-naive bayes classifierPattern recognition binoy 05-naive bayes classifier
Pattern recognition binoy 05-naive bayes classifier108kaushik
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learningshivani saluja
 
Hidden Markov Model paper presentation
Hidden Markov Model paper presentationHidden Markov Model paper presentation
Hidden Markov Model paper presentationShiraz316
 
Multi-Armed Bandit and Applications
Multi-Armed Bandit and ApplicationsMulti-Armed Bandit and Applications
Multi-Armed Bandit and ApplicationsSangwoo Mo
 
01 Analysis of Algorithms: Introduction
01 Analysis of Algorithms: Introduction01 Analysis of Algorithms: Introduction
01 Analysis of Algorithms: IntroductionAndres Mendez-Vazquez
 
Temporal difference learning
Temporal difference learningTemporal difference learning
Temporal difference learningJie-Han Chen
 

What's hot (20)

Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbing
 
Dynamic pgmming
Dynamic pgmmingDynamic pgmming
Dynamic pgmming
 
Lecture 7: Hidden Markov Models (HMMs)
Lecture 7: Hidden Markov Models (HMMs)Lecture 7: Hidden Markov Models (HMMs)
Lecture 7: Hidden Markov Models (HMMs)
 
Deep Q-learning explained
Deep Q-learning explainedDeep Q-learning explained
Deep Q-learning explained
 
Reinforcement learning
Reinforcement  learningReinforcement  learning
Reinforcement learning
 
Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]
Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]
Q-Learning Algorithm: A Concise Introduction [Shakeeb A.]
 
Q-learning
Q-learningQ-learning
Q-learning
 
HIDDEN MARKOV MODEL AND ITS APPLICATION
HIDDEN MARKOV MODEL AND ITS APPLICATIONHIDDEN MARKOV MODEL AND ITS APPLICATION
HIDDEN MARKOV MODEL AND ITS APPLICATION
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in fol
 
Hidden Markov Models
Hidden Markov ModelsHidden Markov Models
Hidden Markov Models
 
Reinforcement learning 7313
Reinforcement learning 7313Reinforcement learning 7313
Reinforcement learning 7313
 
Restricted boltzmann machine
Restricted boltzmann machineRestricted boltzmann machine
Restricted boltzmann machine
 
Pattern recognition binoy 05-naive bayes classifier
Pattern recognition binoy 05-naive bayes classifierPattern recognition binoy 05-naive bayes classifier
Pattern recognition binoy 05-naive bayes classifier
 
Markov chain
Markov chainMarkov chain
Markov chain
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
Hidden Markov Model paper presentation
Hidden Markov Model paper presentationHidden Markov Model paper presentation
Hidden Markov Model paper presentation
 
Multi-Armed Bandit and Applications
Multi-Armed Bandit and ApplicationsMulti-Armed Bandit and Applications
Multi-Armed Bandit and Applications
 
5 csp
5 csp5 csp
5 csp
 
01 Analysis of Algorithms: Introduction
01 Analysis of Algorithms: Introduction01 Analysis of Algorithms: Introduction
01 Analysis of Algorithms: Introduction
 
Temporal difference learning
Temporal difference learningTemporal difference learning
Temporal difference learning
 

More from Ali A Jalil

Clean Code: Successive Refinement
Clean Code: Successive RefinementClean Code: Successive Refinement
Clean Code: Successive RefinementAli A Jalil
 
Image classification
Image classificationImage classification
Image classificationAli A Jalil
 
Photometric calibration
Photometric calibrationPhotometric calibration
Photometric calibrationAli A Jalil
 
Interconnection Network
Interconnection NetworkInterconnection Network
Interconnection NetworkAli A Jalil
 
Features image processing and Extaction
Features image processing and ExtactionFeatures image processing and Extaction
Features image processing and ExtactionAli A Jalil
 

More from Ali A Jalil (10)

Clean Code: Successive Refinement
Clean Code: Successive RefinementClean Code: Successive Refinement
Clean Code: Successive Refinement
 
And or graph
And or graphAnd or graph
And or graph
 
Image classification
Image classificationImage classification
Image classification
 
HDR
HDRHDR
HDR
 
Photometric calibration
Photometric calibrationPhotometric calibration
Photometric calibration
 
Interconnection Network
Interconnection NetworkInterconnection Network
Interconnection Network
 
Polygon drawing
Polygon drawingPolygon drawing
Polygon drawing
 
Polygon drawing
Polygon drawingPolygon drawing
Polygon drawing
 
Features image processing and Extaction
Features image processing and ExtactionFeatures image processing and Extaction
Features image processing and Extaction
 
Text mining
Text miningText mining
Text mining
 

Recently uploaded

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Markov model

  • 2. Introduction  Weather prediction is all about trying to guess what the weather will be like tomorrow based on a history of observations of weather  Let us assume a simplified model of weather prediction  we’ll collect statistics on what the weather was like today based on what the weather was like yesterday the day before and so forth  We want to collect the following probabilities:
  • 3. Introduction  Using above expression we can give probabilities of types of weather for tomorrow and the next day using n days of history  For example if we knew that the weather for the past three days was (sunny, sunny foggy) in chronological order the probability that tomorrow would be rainy is given by:  Here is the problem, the larger n is the more statistics we must collect, Suppose that n=5 then we must collect statistics for 243 past histories
  • 4. Markov Models  Therefore we will make a simplifying assumption called the Markov Assumption:  This is called a first order Markov assumption since we say that the probability of an observation at time n only depends on the observation at time n-1  A second order Markov assumption would have the observation at time n depend on n-1 and n-2.
  • 5. Markov Models  We can the express the joint probability using the Markov assumption:  So this now has a profound affect on the number of histories that we have to find statistics for.  we now only need 32 =9 numbers to characterize the probabilities of all of the sequences.
  • 7. Markov Model – Example  Q: Given that today is sunny what is the probability that tomorrow is sunny and the day after is rainy?,  A: Well this translates into:
  • 8. Markov Model – Example  Q: Given that today is foggy what is the probability that it will be rainy two days from now?  A: There are three ways to get from foggy today to rainy two days from now (foggy, foggy, rainy), (foggy, rainy, rainy) and (foggy, sunny, rainy) Therefore we have to sum over these paths
  • 9. Hidden Markov Model  Well 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 that your caretaker carries an umbrella is 0.1 if the weather is sunny, 0.8 if it is actually raining, and 0.3 if it is foggy.
  • 10. Hidden Markov Model  The equation for the weather Markov process before you were locked in the room was:  However, the actual weather is hidden from you.  Finding the probability of a certain weather qi ∈ {Sunny ,foggy, Cloudy } can only be based on the observation xi, with xi= ☂️ , if your caretaker brought an umbrella on day i  and xi = 🌂 if the caretaker did not bring an umbrella.
  • 11. Hidden Markov Model  This conditional probability P(qi|xi) can be rewritten according to Bayes’ rule:  or, for n days, and weather sequence Q = {q1, . . . , qn}, as well as ‘umbrella sequence’ X = {x1, , . . . , xn}  using the probability P(q1, . . . , qn) of a Markov weather sequence from above, and the probability P(x1, . . . , xn) of seeing a particular sequence of umbrella events (e.g., {☂️ , 🌂 , ☂️ }). The probability P(x1, . . . ,xn|q1,.. .,qn) can be estimated as if you assume that, for all i, the qi, xi are independent of all xj and qj , for all j ≠ i.
  • 12. Hidden Markov Model  We want to draw conclusions from our observations (if the persons carries an umbrella or not) about the weather outside.
  • 13. Hidden Markov Model - Example  Q: Suppose the day you were locked in it was sunny. The next day, the caretaker carried an umbrella into the room. You would like to know, what the weather was like on this second day.  A: First we calculate the likelihood for the second day to be sunny: p(q2 =Sunny|q1 = Sunny, x2 = ☂️) = p(x2 = ☂️ |q2 =Sunny ) * P(q2 = Sunny|q1 =Sunny ) = 0.1* 0.8 = 0.08  then for the second day to be rainy: p(q2 =rainy|q1 =sunny, x2 = ☂️) = P(x2 = ☂️ |q2 = rainy) * P(q2 = ☂️ |q1 =sunny)= 0.8 * 0.05 = 0.04  and finally for the second day to be foggy: p(q2 = |q1 = , x2 = ) = P(x2 = |q2 = ) * P(q2 = |q1 = )= 0.3 *0.15 = 0.045  Thus, although the caretaker did carry an umbrella, it is most likely that on the second day the weather was sunny.