Hidden Markov models 1

Similar documents
Hidden Markov Models. AIMA Chapter 15, Sections 1 5. AIMA Chapter 15, Sections 1 5 1

PROBABILISTIC REASONING OVER TIME

Temporal probability models. Chapter 15

Temporal probability models. Chapter 15, Sections 1 5 1

Dynamic Bayesian Networks and Hidden Markov Models Decision Trees

Course Overview. Summary. Performance of approximation algorithms

CS532, Winter 2010 Hidden Markov Models

Hidden Markov Models (recap BNs)

Human-Oriented Robotics. Temporal Reasoning. Kai Arras Social Robotics Lab, University of Freiburg

CS 7180: Behavioral Modeling and Decision- making in AI

CSE 473: Artificial Intelligence

PROBABILISTIC REASONING Outline

CSCI 360 Introduc/on to Ar/ficial Intelligence Week 2: Problem Solving and Op/miza/on. Professor Wei-Min Shen Week 8.1 and 8.2

Hidden Markov Models. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 19 Apr 2012

CSEP 573: Artificial Intelligence

CS 5522: Artificial Intelligence II

CS 5522: Artificial Intelligence II

Markov Chains and Hidden Markov Models

CS 188: Artificial Intelligence Spring 2009

CS 343: Artificial Intelligence

CS 188: Artificial Intelligence Fall Recap: Inference Example

Hidden Markov Models,99,100! Markov, here I come!

Approximate Inference

CS 7180: Behavioral Modeling and Decision- making in AI

Announcements. CS 188: Artificial Intelligence Fall Markov Models. Example: Markov Chain. Mini-Forward Algorithm. Example

Announcements. CS 188: Artificial Intelligence Fall VPI Example. VPI Properties. Reasoning over Time. Markov Models. Lecture 19: HMMs 11/4/2008

Extensions of Bayesian Networks. Outline. Bayesian Network. Reasoning under Uncertainty. Features of Bayesian Networks.

Advanced Data Science

Markov Models. CS 188: Artificial Intelligence Fall Example. Mini-Forward Algorithm. Stationary Distributions.

Introduction to Artificial Intelligence (AI)

CS 188: Artificial Intelligence Spring Announcements

CSE 473: Artificial Intelligence Spring 2014

Hidden Markov Models. Aarti Singh Slides courtesy: Eric Xing. Machine Learning / Nov 8, 2010

Lecture 4: State Estimation in Hidden Markov Models (cont.)

Lecture 11: Hidden Markov Models

STA 4273H: Statistical Machine Learning

Bayesian Networks BY: MOHAMAD ALSABBAGH

Hidden Markov Models. Vibhav Gogate The University of Texas at Dallas

Hidden Markov Models. By Parisa Abedi. Slides courtesy: Eric Xing

Temporal probability models. Chapter 15, Sections 1 5 1

Linear Dynamical Systems (Kalman filter)

CS 343: Artificial Intelligence

CS 343: Artificial Intelligence

CS 188: Artificial Intelligence Fall 2011

Reasoning Under Uncertainty Over Time. CS 486/686: Introduction to Artificial Intelligence

Outline. CSE 573: Artificial Intelligence Autumn Agent. Partial Observability. Markov Decision Process (MDP) 10/31/2012

Temporal probability models

Mini-project 2 (really) due today! Turn in a printout of your work at the end of the class

Introduction to Machine Learning CMU-10701

CS 5522: Artificial Intelligence II

Linear Dynamical Systems

CS 5522: Artificial Intelligence II

Lecture 4: Hidden Markov Models: An Introduction to Dynamic Decision Making. November 11, 2010

Markov Models and Hidden Markov Models

STA 414/2104: Machine Learning

CSE 473: Ar+ficial Intelligence. Probability Recap. Markov Models - II. Condi+onal probability. Product rule. Chain rule.

CS 188: Artificial Intelligence

CS188 Outline. We re done with Part I: Search and Planning! Part II: Probabilistic Reasoning. Part III: Machine Learning

CS711008Z Algorithm Design and Analysis

Hidden Markov Models

Bayesian Networks: Construction, Inference, Learning and Causal Interpretation. Volker Tresp Summer 2016

9 Forward-backward algorithm, sum-product on factor graphs

Hidden Markov Models. George Konidaris

Our Status in CSE 5522

CS 188: Artificial Intelligence. Our Status in CS188

Note Set 5: Hidden Markov Models

CS325 Artificial Intelligence Ch. 15,20 Hidden Markov Models and Particle Filtering

CSE 473: Artificial Intelligence Probability Review à Markov Models. Outline

Bayesian Methods in Artificial Intelligence

CS 7180: Behavioral Modeling and Decision- making in AI

COMS 4771 Probabilistic Reasoning via Graphical Models. Nakul Verma

Computational Biology Lecture #3: Probability and Statistics. Bud Mishra Professor of Computer Science, Mathematics, & Cell Biology Sept

Bayesian Networks: Construction, Inference, Learning and Causal Interpretation. Volker Tresp Summer 2014

CS188 Outline. CS 188: Artificial Intelligence. Today. Inference in Ghostbusters. Probability. We re done with Part I: Search and Planning!

Robert Collins CSE586 CSE 586, Spring 2015 Computer Vision II

Intelligent Systems (AI-2)

1/30/2012. Reasoning with uncertainty III

Machine Learning for Data Science (CS4786) Lecture 19

CSE 473: Ar+ficial Intelligence

Probability, Markov models and HMMs. Vibhav Gogate The University of Texas at Dallas

Hidden Markov Models NIKOLAY YAKOVETS

Hidden Markov Model. Ying Wu. Electrical Engineering and Computer Science Northwestern University Evanston, IL 60208

Uncertainty and Bayesian Networks

COMP90051 Statistical Machine Learning

Bayesian Machine Learning - Lecture 7

Intelligent Systems (AI-2)

Dynamic Approaches: The Hidden Markov Model

Our Status. We re done with Part I Search and Planning!

Probability. CS 3793/5233 Artificial Intelligence Probability 1

Introduction to Hidden Markov Modeling (HMM) Daniel S. Terry Scott Blanchard and Harel Weinstein labs

Hidden Markov models

Plan for today. ! Part 1: (Hidden) Markov models. ! Part 2: String matching and read mapping

Kalman filtering and friends: Inference in time series models. Herke van Hoof slides mostly by Michael Rubinstein

1 Hidden Markov Models

Sequence labeling. Taking collective a set of interrelated instances x 1,, x T and jointly labeling them

We Live in Exciting Times. CSCI-567: Machine Learning (Spring 2019) Outline. Outline. ACM (an international computing research society) has named

Recall: Modeling Time Series. CSE 586, Spring 2015 Computer Vision II. Hidden Markov Model and Kalman Filter. Modeling Time Series

CS 188: Artificial Intelligence Spring Announcements

CSE 473: Ar+ficial Intelligence. Hidden Markov Models. Bayes Nets. Two random variable at each +me step Hidden state, X i Observa+on, E i

Semi-Markov/Graph Cuts

Transcription:

Hidden Markov models 1

Outline Time and uncertainty Markov process Hidden Markov models Inference: filtering, prediction, smoothing Most likely explanation: Viterbi 2

Time and uncertainty The world changes; we need to track and predict it Weather forecast; speech recognition; diabetes management Basic idea: copy state and evidence variables for each time step X t = set of unobservable state variables at time t e.g., BloodSugar t, StomachContents t, etc. E t = set of observable evidence variables at time t e.g., MeasuredBloodSugar t, P ulserate t, F oodeaten t This assumes discrete time; step size depends on problem Notation: X a:b = X a, X a+1,..., X b 1, X b 3

Markov processes (Markov chains) Construct a Bayes net from these variables: parents? Markov assumption: X t depends on bounded subset of X 0:t 1 First-order Markov process: P(X t X 1:t 1 ) = P(X t X t 1 ) Second-order Markov process: P(X t X 1:t 1 ) = P(X t X t 2, X t 1 ) Stationary process: transition model P(X t X t 1 ) fixed for all t First order X t 2 X t 1 X t X t +1 X t +2 Second order X t 2 X t 1 X t X t +1 X t +2 4

Hidden Markov models - Example Rain t 1 R t 1 t f P(R t ) 0.7 0.3 Rain t Rain t +1 Rt t f P(U t ) 0.9 0.2 Umbrella t 1 Umbrella t Umbrella t +1 5

Hidden Markov models - Definition X t is a single, discrete variable (N states). Domain of X t is {1,..., N} E t is also a discrete variable (M symbols). Domain of E t is {1,..., M} Transition matrix A ij = P (X t = j X t 1 = i), e.g., 0.7 0.3 0.3 0.7 Emission probability distribution B i (k) = P (E t = k X t = i) Prior state occupation π i = P (X 1 = i) e.g., ( 0.7 0.3 ) Hidden Markov modell λ = (A, B, π) First-order Markov process: P(X t X 1:t 1 ) = P(X t X t 1 ) Sensor Markov assumption: P(E t X 1:t, E 1:t 1 ) = P(E t X t ) 6

Hidden Markov model First-order Markov assumption not exactly true in real world! Possible fixes: 1. Increase order of Markov process 2. Augment state, e.g., add T emp t, P ressure t 7

Inference tasks Filtering: P(X t e 1:t ) belief state input to the decision process of a rational agent Prediction: P(X t+k e 1:t ) for k > 0 evaluation of possible action sequences; like filtering without the evidence Smoothing: P(X k e 1:t ) for 0 k < t better estimate of past states, essential for learning Most likely explanation: arg max x1:t P (x 1:t e 1:t ) speech recognition, decoding with a noisy channel 8

Filtering Aim: devise a recursive state estimation algorithm: P(X t+1 e 1:t+1 ) = f(e t+1, P(X t e 1:t )) P(X t+1 e 1:t+1 ) = P(X t+1 e 1:t, e t+1 ) = αp(e t+1 X t+1, e 1:t )P(X t+1 e 1:t ) = αp(e t+1 X t+1 )P(X t+1 e 1:t ) I.e., prediction + estimation. Prediction by summing out X t : P(X t+1 e 1:t+1 ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t, e 1:t )P (x t e 1:t ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t )P (x t e 1:t ) f 1:t+1 = Forward(f 1:t, e t+1 ) where f 1:t = P(X t e 1:t ) Time and space constant (independent of t) 9

Filtering example 0.500 0.500 0.627 0.373 True False 0.500 0.500 0.818 0.182 0.883 0.117 Rain 0 Rain 1 Rain 2 Umbrella 1 Umbrella 2 10

Prediction P(X t+k+1 e 1:t ) = Σ xt+k P(X t+k+1 x t+k )P (x t+k e 1:t ) As k, P (x t+k e 1:t ) tends to the stationary distribution of the Markov chain 11

Smoothing X 0 X 1 X k X t E1 E k Et Divide evidence e 1:t into e 1:k, e k+1:t : P(X k e 1:t ) = P(X k e 1:k, e k+1:t ) = αp(x k e 1:k )P(e k+1:t X k, e 1:k ) = αp(x k e 1:k )P(e k+1:t X k ) = αf 1:k b k+1:t Backward message computed by a backwards recursion: P(e k+1:t X k ) = Σ xk+1 P(e k+1:t X k, x k+1 )P(x k+1 X k ) = Σ xk+1 P (e k+1:t x k+1 )P(x k+1 X k ) = Σ xk+1 P (e k+1 x k+1 )P (e k+2:t x k+1 )P(x k+1 X k ) 12

Smoothing example 0.500 0.500 0.627 0.373 True False 0.500 0.500 0.818 0.182 0.883 0.117 forward 0.883 0.117 0.883 0.117 smoothed 0.690 0.410 1.000 1.000 backward Rain 0 Rain 1 Rain 2 Umbrella 1 Umbrella 2 Forward backward algorithm: cache forward messages along the way Time linear in t (polytree inference), space O(t f ) 13

Most likely explanation Most likely sequence sequence of most likely states!!!! Most likely path to each x t+1 = most likely path to some x t plus one more step max P(x x 1...x 1,..., x t, X t+1 e 1:t+1 ) t = P(e t+1 X t+1 ) max P(Xt+1 x x t ) max P (x t x 1...x 1,..., x t 1, x t e 1:t ) t 1 Identical to filtering, except f 1:t replaced by m 1:t = max P(x x 1...x 1,..., x t 1, X t e 1:t ), t 1 I.e., m 1:t (i) gives the probability of the most likely path to state i. Update has sum replaced by max, giving the Viterbi algorithm: m 1:t+1 = P(e t+1 X t+1 ) max x t (P(X t+1 x t )m 1:t ) 14

Viterbi example Rain 1 Rain 2 Rain 3 Rain 4 Rain 5 state space paths true false true false true false true false true false umbrella true true false true true most likely paths.8182.5155.0361.0334.0210.1818.0491.1237.0173.0024 m 1:1 m 1:2 m 1:3 m 1:4 m 1:5 15

Summary Temporal models use state and sensor variables replicated over time Markov assumptions and stationarity assumption, so we need transition model P(X t X t 1 ) sensor model P(E t X t ) Tasks are filtering, prediction, smoothing, most likely sequence; all done recursively with constant cost per time step 16