SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Week 10:
Hidden Markov Models
Russell & Norvig, Chapter 15.
(Most of slides from Dan Klein, Pieter Abbeel)
Probability Recap
 Conditional probability
 Product rule
 Chain rule
 X, Y independent if and only if:
 X and Y are conditionally independent given Z if and only if:
Reasoning over Time or Space
 Often, we want to reason about a sequence of observations
where the state of the underlying system is changing
 Speech recognition
 Robot localization
 User attention
 Medical monitoring
 Global climate
 Need to introduce time into our models
Markov assumption
 Markov assumption: The assumption that the
current state depends on only a finite fixed
number of previous states.
 Markov chain: a sequence of random variables
where the distribution of each variable follows the
Markov assumption
Markov assumption
Markov assumption
Markov Models (aka Markov chain/process)
 Value of X at a given time is called the state (usually discrete, finite)
 The transition model P(Xt | Xt-1) specifies how the state evolves over time
 Stationarity assumption: transition probabilities are the same at all times
 Markov assumption: “future is independent of the past given the present”
 Xt+1 is independent of X0,…, Xt-1 given Xt
 This is a first-order Markov model (a kth-order model allows dependencies on k earlier steps)
 Joint distribution P(X0,…, XT) = P(X0) t P(Xt | Xt-1)
X1
X0 X2 X3
P(X0) P(Xt | Xt-1)
Markov Models (aka Markov chain/process)
P(Xt | Xt-1)
First-order Markov process: the current state depends only on the previous state and not on
any earlier states. P(Xt | X0:t-1) =
Current t-1 state provides enough information to make the future conditionally independent of the past,
Second-order Markov process: The transition model for a second-order Markov process is the
conditional distribution P(Xt | Xt-2 , Xt-1)
Sensor Markov assumption (observation model)
P(Et | X0:t, E0:t-1) =
Example Markov Chain: Weather
 States: X = {rain, sun}
rain sun
0.9
0.7
0.3
0.1
Two new ways of representing the same CPT
sun
rain
sun
rain
0.1
0.9
0.7
0.3
Xt-1 Xt P(Xt|Xt-1)
sun sun 0.9
sun rain 0.1
rain sun 0.3
rain rain 0.7
 Initial distribution: 1.0 sun
 CPT P(Xt | Xt-1):
Example Markov Chain: Weather
 Initial distribution: 1.0 sun
 What is the probability distribution after one step?
rain sun
0.9
0.7
0.3
0.1
Mini-Forward Algorithm
 Question: What’s P(X) on some day t?
Forward simulation
X2
X1 X3 X4
Example Run of Mini-Forward Algorithm
 From initial observation of sun
 From initial observation of rain
 From yet another initial distribution P(X1):
P(X1) P(X2) P(X3) P(X)
P(X4)
P(X1) P(X2) P(X3) P(X)
P(X4)
P(X1) P(X)
…
[Demo: L13D1,2,3]
Forward algorithm (simple form)
 What is the state at time t?
 P(Xt) = xt-1
P(Xt,Xt-1=xt-1)
 = xt-1
P(Xt-1=xt-1) P(Xt| Xt-1=xt-1)
 Iterate this update starting at t=0
 P(X1) = P(X1 )
 P(X2) = P(X1 ) P(X2 | X1)
 P (X3 ) = P(X2) P(X3 | X2)
 P(X1, X2, X3) = P(X1 ) P(X2 | X1) P(X3 | X2)
Probability from
previous iteration
Transition model
Hidden Markov Models
 Markov chains not so useful for most agents
 Need observations to update your beliefs
 Hidden Markov models (HMMs)
 Underlying Markov chain over states X
 You observe outputs (effects) at each time step
X5
X2
E1
X1 X3 X4
E2 E3 E4 E5
• An HMM is a temporal probabilistic model in which the
state of the process is described by a single, discrete
random variable
• HMMs require the state to be a single, discrete
variable, there is no corresponding restriction on the
evidence variables.
Example: Weather HMM
Rt-1 Rt P(Rt|Rt-1)
+r +r 0.7
-r +r 0.3
Umbrellat-1
Rt Ut P(Ut|Rt)
+r +u 0.9
-r +u 0.1
Umbrellat Umbrellat+1
Raint-1 Raint Raint+1
 An HMM is defined by: (Markov Chains +
observed Variables)
 Initial distribution:
 Transitions:
 Emissions:
Figure 2: Bayesian network structure and conditional distributions describing the umbrella world. The
transition model is P(Raint | Raint−1) and the sensor model is P(Umbrellat | Raint).
Formally Joint Distribution of an HMM
X5
E5
X2
E1
X1 X3
E2 E3
P(X1, E1, X2, E2, X3, E3) = P(X1 ) P(E1 | X1) P(X2 | X1) P(E2 | X2) P(X3 | X2) P(E3 | X3)
• Jointdistribution
P(X1, E1,…, XT, ET) = P(X1) P(E1 | X1) t
2 P(Xt | Xt-1) P(Et | Xt)
• More generally
Example: Weather HMM
Rt Rt+1 P(Rt+1|Rt)
+r +r 0.7
+r -r 0.3
-r +r 0.3
-r -r 0.7
Rt Ut P(Ut|Rt)
+r +u 0.9
+r -u 0.1
-r +u 0.2
-r -u 0.8
Umbrella1 Umbrella2
Rain0 Rain1 Rain2
B(+r) = 0.5
B(-r) = 0.5
On day 0, we have no observations, only the security guard’s prior
beliefs; let’s assume that consists of P(R0) = 0.5, 0.5.
Transition Probabilities Emission Probabilities
P(R1) = P(Ro ) P(R1 | Ro)
P(R1) = P(+ Ro ) P(+R1 | +Ro) + P(-Ro ) P(-R1 | -Ro)
Example: Weather HMM
Rt Rt+1 P(Rt+1|Rt)
+r +r 0.7
+r -r 0.3
-r +r 0.3
-r -r 0.7
Rt Ut P(Ut|Rt)
+r +u 0.9
+r -u 0.1
-r +u 0.2
-r -u 0.8
Umbrella1 Umbrella2
Rain0 Rain1 Rain2
B(+r) = 0.5
B(-r) = 0.5
On day 1, the umbrella appears, so U = true, The prediction from t = 0 to t == 1 is
P(R1) = r0
P(R1| r0 ) P(r0 )
and updating it with the evidence for t = 1 gives
Transition Probabilities Emission Probabilities
Example: Weather HMM
On day 1, the umbrella appears, so U = true, The prediction from t = 0 to t == 1 is
P(R1) = r0
P(R1| r0 ) P(r0 )
and updating it with the evidence for t = 1 gives
On day 2, the umbrella appears, so U = true, The prediction from t = 1 to t == 2 is
and updating it with the evidence for t = 2 gives
Example: Weather HMM
Rt Rt+1 P(Rt+1|Rt)
+r +r 0.7
+r -r 0.3
-r +r 0.3
-r -r 0.7
Rt Ut P(Ut|Rt)
+r +u 0.9
+r -u 0.1
-r +u 0.2
-r -u 0.8
Umbrella1 Umbrella2
Rain0 Rain1 Rain2
B(+r) = 0.5
B(-r) = 0.5
B’(+r) = 0.5
B’(-r) = 0.5
B(+r) = 0.818
B(-r) = 0.182
B’(+r) = 0.627
B’(-r) = 0.373
B(+r) = 0.883
B(-r) = 0.117
Emission Probabilities
Transition Probabilities
Example 2: Weather and Mode HMM
Example: Consider the example which elaborates how a person feels on different climates.
Example 2: Weather and Mode HMM
grumpy1 Happy2
Sunny0 Rain1 Sunny2
Happy0
Example: Consider the example which elaborates how a person feels on different climates.
Example 2: Weather and Mode HMM
Example: Consider the example which elaborates how a person feels on different climates.
Transition Probabilities
8
2
2
3
0.8
0.2
0.4
0.6
St St+1 P(St+1|St)
sunny sunny 0.8
sunny rainy 0.2
rainy rainy 0.6
rainy sunny 0.4
Transition Probabilities
Example 2: Weather and Mode HMM
Example: Consider the example which elaborates how a person feels on different climates.
Emission Probabilities
8
2
2
3
0.8
0.2
0.4
0.6
St Ht P(Ht|St)
sunny happy 0.8
sunny grumpy 0.2
rainy happy 0.4
rainy grumpy 0.6
Emission Probabilities
Example 2: Weather and Mode HMM
Example: Consider the example which elaborates how a person feels on different climates.
Probability of sunny
10 / 15 0.67
Probability of rainy
5 / 15 0.33
Probability of happy
10 / 15 0.67
Probability of grumpy
5 / 15 0.33
Example 2: Weather and Mode HMM
St St+1 P(St+1|St)
sunny sunny 0.8
sunny rainy 0.2
rainy rainy 0.6
rainy sunny 0.4
St Ht P(Ht|St)
sunny happy 0.8
sunny grumpy 0.2
rainy happy 0.4
rainy grumpy 0.6
If Happy today, what is probability its sunny or rainy?
P(Sunny|Happy) = P(Happy|Sunny) P(sunny) / P(Happy) => 0.8 *
0.67/ 0.67 => 0.8
P(rainy|Happy) = P(Happy|rainy) P(rainy)/ P(Happy) => 0.4 * 0.33
/ 0.67 = 0.2
Example 2: Weather and Mode HMM
St St+1 P(St+1|St)
sunny sunny 0.8
sunny rainy 0.2
rainy rainy 0.6
rainy sunny 0.4
St Ht P(Ht|St)
sunny happy 0.8
sunny grumpy 0.2
rainy happy 0.4
rainy grumpy 0.6
If Happy-grumpy, what is weather for 2 days?
• P(Sunny, Rainy) = P(Sunny) P(Happy | Sunny) P (Rainy | Sunny) P(grumpy | Rainy)
• P(Sunny, Rainy) = 0.67 * 0.8 * 0.2 * 0.6 => 0.064
• P(Sunny, Sunny) = P(Sunny) P(Happy | Sunny) P (Sunny | Sunny) P(grumpy | Sunny)
• P(Sunny, Rainy) = 0.67 * 0.8 * 0.8 * 0.2 => 0.085
• P(Rainy, Sunny) = P(Rainy) P(Happy | Rainy) P (Rainy | Sunny) P(grumpy | Sunny)
• P(Sunny, Rainy) = 0.33 * 0.4 * 0.4 * 0.2 => 0.010
Example 2: Weather and Mode HMM
Filtering / Monitoring
 Filtering, or monitoring, is the task of tracking the distribution Bt(X) = Pt(Xt
| e1, …, et) (the belief state) over time
 We start with B1(X) in an initial setting, usually uniform
 As time passes, or we get observations, we update B(X)
 The Kalman filter was invented in the 60’s and first implemented as a
method of trajectory estimation for the Apollo program.
 With HMM infer discrete, finite variable and using Kalman filter we can
have inference of continuous variables.

Weitere ähnliche Inhalte

Was ist angesagt?

PRML Chapter 7
PRML Chapter 7PRML Chapter 7
PRML Chapter 7Sunwoo Kim
 
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithmno U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithmChristian Robert
 
Hidden Markov Model - The Most Probable Path
Hidden Markov Model - The Most Probable PathHidden Markov Model - The Most Probable Path
Hidden Markov Model - The Most Probable PathLê Hòa
 
Lecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation MaximizationLecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation Maximizationbutest
 
Hidden Markov Model & It's Application in Python
Hidden Markov Model & It's Application in PythonHidden Markov Model & It's Application in Python
Hidden Markov Model & It's Application in PythonAbhay Dodiya
 
A Beginner's Guide to Machine Learning with Scikit-Learn
A Beginner's Guide to Machine Learning with Scikit-LearnA Beginner's Guide to Machine Learning with Scikit-Learn
A Beginner's Guide to Machine Learning with Scikit-LearnSarah Guido
 
Hidden markov models
Hidden markov modelsHidden markov models
Hidden markov modelsAhmed Jamshed
 
Probability and random processes project based learning template.pdf
Probability and random processes project based learning template.pdfProbability and random processes project based learning template.pdf
Probability and random processes project based learning template.pdfVedant Srivastava
 
Naive bayes
Naive bayesNaive bayes
Naive bayesumeskath
 
Bayesian Deep Learning
Bayesian Deep LearningBayesian Deep Learning
Bayesian Deep LearningRayKim51
 
K nearest neighbor
K nearest neighborK nearest neighbor
K nearest neighborUjjawal
 
Lecture 1 graphical models
Lecture 1  graphical modelsLecture 1  graphical models
Lecture 1 graphical modelsDuy Tung Pham
 
Inference rulesproofmethods
Inference rulesproofmethodsInference rulesproofmethods
Inference rulesproofmethodsRajendran
 
Solving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithmSolving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithmAlex Bidanets
 
Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...
Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...
Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...Aditya Yadav
 
Chap 8. Optimization for training deep models
Chap 8. Optimization for training deep modelsChap 8. Optimization for training deep models
Chap 8. Optimization for training deep modelsYoung-Geun Choi
 
Exact Matrix Completion via Convex Optimization Slide (PPT)
Exact Matrix Completion via Convex Optimization Slide (PPT)Exact Matrix Completion via Convex Optimization Slide (PPT)
Exact Matrix Completion via Convex Optimization Slide (PPT)Joonyoung Yi
 

Was ist angesagt? (20)

PRML Chapter 7
PRML Chapter 7PRML Chapter 7
PRML Chapter 7
 
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithmno U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
 
Hidden Markov Model - The Most Probable Path
Hidden Markov Model - The Most Probable PathHidden Markov Model - The Most Probable Path
Hidden Markov Model - The Most Probable Path
 
Hmm viterbi
Hmm viterbiHmm viterbi
Hmm viterbi
 
Lecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation MaximizationLecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation Maximization
 
Hidden Markov Model & It's Application in Python
Hidden Markov Model & It's Application in PythonHidden Markov Model & It's Application in Python
Hidden Markov Model & It's Application in Python
 
A Beginner's Guide to Machine Learning with Scikit-Learn
A Beginner's Guide to Machine Learning with Scikit-LearnA Beginner's Guide to Machine Learning with Scikit-Learn
A Beginner's Guide to Machine Learning with Scikit-Learn
 
Hidden markov models
Hidden markov modelsHidden markov models
Hidden markov models
 
Probability and random processes project based learning template.pdf
Probability and random processes project based learning template.pdfProbability and random processes project based learning template.pdf
Probability and random processes project based learning template.pdf
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Bayesian Deep Learning
Bayesian Deep LearningBayesian Deep Learning
Bayesian Deep Learning
 
K nearest neighbor
K nearest neighborK nearest neighbor
K nearest neighbor
 
Lecture 1 graphical models
Lecture 1  graphical modelsLecture 1  graphical models
Lecture 1 graphical models
 
Inference rulesproofmethods
Inference rulesproofmethodsInference rulesproofmethods
Inference rulesproofmethods
 
Solving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithmSolving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithm
 
Active learning
Active learningActive learning
Active learning
 
Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...
Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...
Automatski - RSA-2048 Cryptography Cracked using Shor's Algorithm on a Quantu...
 
Chap 8. Optimization for training deep models
Chap 8. Optimization for training deep modelsChap 8. Optimization for training deep models
Chap 8. Optimization for training deep models
 
KNN
KNNKNN
KNN
 
Exact Matrix Completion via Convex Optimization Slide (PPT)
Exact Matrix Completion via Convex Optimization Slide (PPT)Exact Matrix Completion via Convex Optimization Slide (PPT)
Exact Matrix Completion via Convex Optimization Slide (PPT)
 

Ähnlich wie Hidden Markov Models.pptx

The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...Tim Reis
 
Estimating Future Initial Margin with Machine Learning
Estimating Future Initial Margin with Machine LearningEstimating Future Initial Margin with Machine Learning
Estimating Future Initial Margin with Machine LearningAndres Hernandez
 
Natalini nse slide_giu2013
Natalini nse slide_giu2013Natalini nse slide_giu2013
Natalini nse slide_giu2013Madd Maths
 
Notes mech v
Notes mech vNotes mech v
Notes mech vRung Heo
 
Controllability of Linear Dynamical System
Controllability of  Linear Dynamical SystemControllability of  Linear Dynamical System
Controllability of Linear Dynamical SystemPurnima Pandit
 
Robust model predictive control for discrete-time fractional-order systems
Robust model predictive control for discrete-time fractional-order systemsRobust model predictive control for discrete-time fractional-order systems
Robust model predictive control for discrete-time fractional-order systemsPantelis Sopasakis
 
Ray : modeling dynamic systems
Ray : modeling dynamic systemsRay : modeling dynamic systems
Ray : modeling dynamic systemsHouw Liong The
 
PART VII.3 - Quantum Electrodynamics
PART VII.3 - Quantum ElectrodynamicsPART VII.3 - Quantum Electrodynamics
PART VII.3 - Quantum ElectrodynamicsMaurice R. TREMBLAY
 
Poster Gauge systems and functions, hermitian operators and clocks as conjuga...
Poster Gauge systems and functions, hermitian operators and clocks as conjuga...Poster Gauge systems and functions, hermitian operators and clocks as conjuga...
Poster Gauge systems and functions, hermitian operators and clocks as conjuga...vcuesta
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical MethodsTeja Ande
 
Bloco2 produtos gerados_pelo_inpe
Bloco2 produtos gerados_pelo_inpeBloco2 produtos gerados_pelo_inpe
Bloco2 produtos gerados_pelo_inpeDafmet Ufpel
 
A short remark on Feller’s square root condition.
A short remark on Feller’s square root condition.A short remark on Feller’s square root condition.
A short remark on Feller’s square root condition.Ilya Gikhman
 
Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3Fabian Pedregosa
 

Ähnlich wie Hidden Markov Models.pptx (20)

The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
 
Estimating Future Initial Margin with Machine Learning
Estimating Future Initial Margin with Machine LearningEstimating Future Initial Margin with Machine Learning
Estimating Future Initial Margin with Machine Learning
 
Ch03 9
Ch03 9Ch03 9
Ch03 9
 
Natalini nse slide_giu2013
Natalini nse slide_giu2013Natalini nse slide_giu2013
Natalini nse slide_giu2013
 
time response
time responsetime response
time response
 
PART I.2 - Physical Mathematics
PART I.2 - Physical MathematicsPART I.2 - Physical Mathematics
PART I.2 - Physical Mathematics
 
Notes mech v
Notes mech vNotes mech v
Notes mech v
 
Controllability of Linear Dynamical System
Controllability of  Linear Dynamical SystemControllability of  Linear Dynamical System
Controllability of Linear Dynamical System
 
Robust model predictive control for discrete-time fractional-order systems
Robust model predictive control for discrete-time fractional-order systemsRobust model predictive control for discrete-time fractional-order systems
Robust model predictive control for discrete-time fractional-order systems
 
Ray : modeling dynamic systems
Ray : modeling dynamic systemsRay : modeling dynamic systems
Ray : modeling dynamic systems
 
002 ray modeling dynamic systems
002 ray modeling dynamic systems002 ray modeling dynamic systems
002 ray modeling dynamic systems
 
002 ray modeling dynamic systems
002 ray modeling dynamic systems002 ray modeling dynamic systems
002 ray modeling dynamic systems
 
PCA on graph/network
PCA on graph/networkPCA on graph/network
PCA on graph/network
 
PART VII.3 - Quantum Electrodynamics
PART VII.3 - Quantum ElectrodynamicsPART VII.3 - Quantum Electrodynamics
PART VII.3 - Quantum Electrodynamics
 
Adaptive dynamic programming algorithm for uncertain nonlinear switched systems
Adaptive dynamic programming algorithm for uncertain nonlinear switched systemsAdaptive dynamic programming algorithm for uncertain nonlinear switched systems
Adaptive dynamic programming algorithm for uncertain nonlinear switched systems
 
Poster Gauge systems and functions, hermitian operators and clocks as conjuga...
Poster Gauge systems and functions, hermitian operators and clocks as conjuga...Poster Gauge systems and functions, hermitian operators and clocks as conjuga...
Poster Gauge systems and functions, hermitian operators and clocks as conjuga...
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
Bloco2 produtos gerados_pelo_inpe
Bloco2 produtos gerados_pelo_inpeBloco2 produtos gerados_pelo_inpe
Bloco2 produtos gerados_pelo_inpe
 
A short remark on Feller’s square root condition.
A short remark on Feller’s square root condition.A short remark on Feller’s square root condition.
A short remark on Feller’s square root condition.
 
Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3Random Matrix Theory and Machine Learning - Part 3
Random Matrix Theory and Machine Learning - Part 3
 

Kürzlich hochgeladen

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 

Kürzlich hochgeladen (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 

Hidden Markov Models.pptx

  • 1. Week 10: Hidden Markov Models Russell & Norvig, Chapter 15. (Most of slides from Dan Klein, Pieter Abbeel)
  • 2. Probability Recap  Conditional probability  Product rule  Chain rule  X, Y independent if and only if:  X and Y are conditionally independent given Z if and only if:
  • 3. Reasoning over Time or Space  Often, we want to reason about a sequence of observations where the state of the underlying system is changing  Speech recognition  Robot localization  User attention  Medical monitoring  Global climate  Need to introduce time into our models
  • 4. Markov assumption  Markov assumption: The assumption that the current state depends on only a finite fixed number of previous states.  Markov chain: a sequence of random variables where the distribution of each variable follows the Markov assumption
  • 7. Markov Models (aka Markov chain/process)  Value of X at a given time is called the state (usually discrete, finite)  The transition model P(Xt | Xt-1) specifies how the state evolves over time  Stationarity assumption: transition probabilities are the same at all times  Markov assumption: “future is independent of the past given the present”  Xt+1 is independent of X0,…, Xt-1 given Xt  This is a first-order Markov model (a kth-order model allows dependencies on k earlier steps)  Joint distribution P(X0,…, XT) = P(X0) t P(Xt | Xt-1) X1 X0 X2 X3 P(X0) P(Xt | Xt-1)
  • 8. Markov Models (aka Markov chain/process) P(Xt | Xt-1) First-order Markov process: the current state depends only on the previous state and not on any earlier states. P(Xt | X0:t-1) = Current t-1 state provides enough information to make the future conditionally independent of the past, Second-order Markov process: The transition model for a second-order Markov process is the conditional distribution P(Xt | Xt-2 , Xt-1) Sensor Markov assumption (observation model) P(Et | X0:t, E0:t-1) =
  • 9. Example Markov Chain: Weather  States: X = {rain, sun} rain sun 0.9 0.7 0.3 0.1 Two new ways of representing the same CPT sun rain sun rain 0.1 0.9 0.7 0.3 Xt-1 Xt P(Xt|Xt-1) sun sun 0.9 sun rain 0.1 rain sun 0.3 rain rain 0.7  Initial distribution: 1.0 sun  CPT P(Xt | Xt-1):
  • 10. Example Markov Chain: Weather  Initial distribution: 1.0 sun  What is the probability distribution after one step? rain sun 0.9 0.7 0.3 0.1
  • 11. Mini-Forward Algorithm  Question: What’s P(X) on some day t? Forward simulation X2 X1 X3 X4
  • 12. Example Run of Mini-Forward Algorithm  From initial observation of sun  From initial observation of rain  From yet another initial distribution P(X1): P(X1) P(X2) P(X3) P(X) P(X4) P(X1) P(X2) P(X3) P(X) P(X4) P(X1) P(X) … [Demo: L13D1,2,3]
  • 13. Forward algorithm (simple form)  What is the state at time t?  P(Xt) = xt-1 P(Xt,Xt-1=xt-1)  = xt-1 P(Xt-1=xt-1) P(Xt| Xt-1=xt-1)  Iterate this update starting at t=0  P(X1) = P(X1 )  P(X2) = P(X1 ) P(X2 | X1)  P (X3 ) = P(X2) P(X3 | X2)  P(X1, X2, X3) = P(X1 ) P(X2 | X1) P(X3 | X2) Probability from previous iteration Transition model
  • 14. Hidden Markov Models  Markov chains not so useful for most agents  Need observations to update your beliefs  Hidden Markov models (HMMs)  Underlying Markov chain over states X  You observe outputs (effects) at each time step X5 X2 E1 X1 X3 X4 E2 E3 E4 E5 • An HMM is a temporal probabilistic model in which the state of the process is described by a single, discrete random variable • HMMs require the state to be a single, discrete variable, there is no corresponding restriction on the evidence variables.
  • 15. Example: Weather HMM Rt-1 Rt P(Rt|Rt-1) +r +r 0.7 -r +r 0.3 Umbrellat-1 Rt Ut P(Ut|Rt) +r +u 0.9 -r +u 0.1 Umbrellat Umbrellat+1 Raint-1 Raint Raint+1  An HMM is defined by: (Markov Chains + observed Variables)  Initial distribution:  Transitions:  Emissions: Figure 2: Bayesian network structure and conditional distributions describing the umbrella world. The transition model is P(Raint | Raint−1) and the sensor model is P(Umbrellat | Raint).
  • 16. Formally Joint Distribution of an HMM X5 E5 X2 E1 X1 X3 E2 E3 P(X1, E1, X2, E2, X3, E3) = P(X1 ) P(E1 | X1) P(X2 | X1) P(E2 | X2) P(X3 | X2) P(E3 | X3) • Jointdistribution P(X1, E1,…, XT, ET) = P(X1) P(E1 | X1) t 2 P(Xt | Xt-1) P(Et | Xt) • More generally
  • 17. Example: Weather HMM Rt Rt+1 P(Rt+1|Rt) +r +r 0.7 +r -r 0.3 -r +r 0.3 -r -r 0.7 Rt Ut P(Ut|Rt) +r +u 0.9 +r -u 0.1 -r +u 0.2 -r -u 0.8 Umbrella1 Umbrella2 Rain0 Rain1 Rain2 B(+r) = 0.5 B(-r) = 0.5 On day 0, we have no observations, only the security guard’s prior beliefs; let’s assume that consists of P(R0) = 0.5, 0.5. Transition Probabilities Emission Probabilities P(R1) = P(Ro ) P(R1 | Ro) P(R1) = P(+ Ro ) P(+R1 | +Ro) + P(-Ro ) P(-R1 | -Ro)
  • 18. Example: Weather HMM Rt Rt+1 P(Rt+1|Rt) +r +r 0.7 +r -r 0.3 -r +r 0.3 -r -r 0.7 Rt Ut P(Ut|Rt) +r +u 0.9 +r -u 0.1 -r +u 0.2 -r -u 0.8 Umbrella1 Umbrella2 Rain0 Rain1 Rain2 B(+r) = 0.5 B(-r) = 0.5 On day 1, the umbrella appears, so U = true, The prediction from t = 0 to t == 1 is P(R1) = r0 P(R1| r0 ) P(r0 ) and updating it with the evidence for t = 1 gives Transition Probabilities Emission Probabilities
  • 19. Example: Weather HMM On day 1, the umbrella appears, so U = true, The prediction from t = 0 to t == 1 is P(R1) = r0 P(R1| r0 ) P(r0 ) and updating it with the evidence for t = 1 gives On day 2, the umbrella appears, so U = true, The prediction from t = 1 to t == 2 is and updating it with the evidence for t = 2 gives
  • 20. Example: Weather HMM Rt Rt+1 P(Rt+1|Rt) +r +r 0.7 +r -r 0.3 -r +r 0.3 -r -r 0.7 Rt Ut P(Ut|Rt) +r +u 0.9 +r -u 0.1 -r +u 0.2 -r -u 0.8 Umbrella1 Umbrella2 Rain0 Rain1 Rain2 B(+r) = 0.5 B(-r) = 0.5 B’(+r) = 0.5 B’(-r) = 0.5 B(+r) = 0.818 B(-r) = 0.182 B’(+r) = 0.627 B’(-r) = 0.373 B(+r) = 0.883 B(-r) = 0.117 Emission Probabilities Transition Probabilities
  • 21. Example 2: Weather and Mode HMM Example: Consider the example which elaborates how a person feels on different climates.
  • 22. Example 2: Weather and Mode HMM grumpy1 Happy2 Sunny0 Rain1 Sunny2 Happy0 Example: Consider the example which elaborates how a person feels on different climates.
  • 23. Example 2: Weather and Mode HMM Example: Consider the example which elaborates how a person feels on different climates. Transition Probabilities 8 2 2 3 0.8 0.2 0.4 0.6 St St+1 P(St+1|St) sunny sunny 0.8 sunny rainy 0.2 rainy rainy 0.6 rainy sunny 0.4 Transition Probabilities
  • 24. Example 2: Weather and Mode HMM Example: Consider the example which elaborates how a person feels on different climates. Emission Probabilities 8 2 2 3 0.8 0.2 0.4 0.6 St Ht P(Ht|St) sunny happy 0.8 sunny grumpy 0.2 rainy happy 0.4 rainy grumpy 0.6 Emission Probabilities
  • 25. Example 2: Weather and Mode HMM Example: Consider the example which elaborates how a person feels on different climates. Probability of sunny 10 / 15 0.67 Probability of rainy 5 / 15 0.33 Probability of happy 10 / 15 0.67 Probability of grumpy 5 / 15 0.33
  • 26. Example 2: Weather and Mode HMM St St+1 P(St+1|St) sunny sunny 0.8 sunny rainy 0.2 rainy rainy 0.6 rainy sunny 0.4 St Ht P(Ht|St) sunny happy 0.8 sunny grumpy 0.2 rainy happy 0.4 rainy grumpy 0.6 If Happy today, what is probability its sunny or rainy? P(Sunny|Happy) = P(Happy|Sunny) P(sunny) / P(Happy) => 0.8 * 0.67/ 0.67 => 0.8 P(rainy|Happy) = P(Happy|rainy) P(rainy)/ P(Happy) => 0.4 * 0.33 / 0.67 = 0.2
  • 27. Example 2: Weather and Mode HMM St St+1 P(St+1|St) sunny sunny 0.8 sunny rainy 0.2 rainy rainy 0.6 rainy sunny 0.4 St Ht P(Ht|St) sunny happy 0.8 sunny grumpy 0.2 rainy happy 0.4 rainy grumpy 0.6 If Happy-grumpy, what is weather for 2 days? • P(Sunny, Rainy) = P(Sunny) P(Happy | Sunny) P (Rainy | Sunny) P(grumpy | Rainy) • P(Sunny, Rainy) = 0.67 * 0.8 * 0.2 * 0.6 => 0.064 • P(Sunny, Sunny) = P(Sunny) P(Happy | Sunny) P (Sunny | Sunny) P(grumpy | Sunny) • P(Sunny, Rainy) = 0.67 * 0.8 * 0.8 * 0.2 => 0.085 • P(Rainy, Sunny) = P(Rainy) P(Happy | Rainy) P (Rainy | Sunny) P(grumpy | Sunny) • P(Sunny, Rainy) = 0.33 * 0.4 * 0.4 * 0.2 => 0.010
  • 28. Example 2: Weather and Mode HMM
  • 29. Filtering / Monitoring  Filtering, or monitoring, is the task of tracking the distribution Bt(X) = Pt(Xt | e1, …, et) (the belief state) over time  We start with B1(X) in an initial setting, usually uniform  As time passes, or we get observations, we update B(X)  The Kalman filter was invented in the 60’s and first implemented as a method of trajectory estimation for the Apollo program.  With HMM infer discrete, finite variable and using Kalman filter we can have inference of continuous variables.

Hinweis der Redaktion

  1. P(rain) = > P(rain | sun) P(sun) + P (rain|rain) P(rain) 0.1 * 1 + 0.7 * 0 = 0.1
  2. P(sun) = > P(sun | sun) P(sun) + P (sun | rain) P(rain) 0.9 * 0.9 + 0.3 * 0.1 = 0.84 P(rain) = > P(rain | sun) P(sun) + P (rain | rain) P(rain) 0.1 * 0.9 + 0.7 * 0.1 = 0.09 + 0.07 = 0.16
  3. demo
  4. demo
  5. The formula for normalization is P (Sunny, Cool) / P (Sunny, Cool) + P (rain, Cool) 0.45 / 0.45 + 0.1  = 0.45/ 0.55  = 0.818 0.1/ 0.55 = 0.1818  P(rain1) = > P(rain1 | rain0) P(rain0) + P (rain1 | - rain0) P(- rain0) P(rain1) = 0.7 * 0.5 + 0.3 * 0.5 = 0.5
  6. P (R1 | u1) = P(u1 | R1) P (R1) / P (u1) Remove P (u1) for division to get approximation a = show approximation P (R1 | u1) = a P(u1 | R1) P (R1) P (R1 | u1) = 0.45 P(u1) = 0.55 P (R1 | u1) = 0.45 / 1.1 Procedure: Step 1: Compute Z = sum over all entries Step 2: Divide every entry by Z
  7. demo
  8. demo
  9. demo
  10. demo
  11. demo
  12. demo
  13. a = show approximation P(Sunny|Happy) = a P(Happy|Sunny) P(sunny) = a 0.8 * 0.67 = 0.536 P (rainy | happy) = a P(Happy|rainy) P(rainy) = a 0.4 * 0.33 = 0.132 So after approximation ~~ P(Sunny|Happy) = <0.546> = <0.8>
  14. demo
  15. demo