1 Hidden Markov Model Xiaole Shirley Liu STAT115, STAT215.

Slides:



Advertisements
Similar presentations
Lecture 16 Hidden Markov Models. HMM Until now we only considered IID data. Some data are of sequential nature, i.e. have correlations have time. Example:
Advertisements

Hidden Markov Models (HMM) Rabiner’s Paper
HMM II: Parameter Estimation. Reminder: Hidden Markov Model Markov Chain transition probabilities: p(S i+1 = t|S i = s) = a st Emission probabilities:
Learning HMM parameters
Hidden Markov Model.
1 Hidden Markov Model Xiaole Shirley Liu STAT115, STAT215, BIO298, BIST520.
Hidden Markov Models Chapter 11. CG “islands” The dinucleotide “CG” is rare –C in a “CG” often gets “methylated” and the resulting C then mutates to T.
Hidden Markov Model 主講人:虞台文 大同大學資工所 智慧型多媒體研究室. Contents Introduction – Markov Chain – Hidden Markov Model (HMM) Formal Definition of HMM & Problems Estimate.
HIDDEN MARKOV MODELS Prof. Navneet Goyal Department of Computer Science BITS, Pilani Presentation based on: & on presentation on HMM by Jianfeng Tang Old.
Hidden Markov Models. A Hidden Markov Model consists of 1.A sequence of states {X t |t  T } = {X 1, X 2,..., X T }, and 2.A sequence of observations.
Introduction to Hidden Markov Models
Hidden Markov Models Bonnie Dorr Christof Monz CMSC 723: Introduction to Computational Linguistics Lecture 5 October 6, 2004.
Hidden Markov Models Modified from:
Page 1 Hidden Markov Models for Automatic Speech Recognition Dr. Mike Johnson Marquette University, EECE Dept.
Hidden Markov Models Ellen Walker Bioinformatics Hiram College, 2008.
Statistical NLP: Lecture 11
Ch-9: Markov Models Prepared by Qaiser Abbas ( )
Profiles for Sequences
Hidden Markov Models Theory By Johan Walters (SR 2003)
Statistical NLP: Hidden Markov Models Updated 8/12/2005.
1 Hidden Markov Models (HMMs) Probabilistic Automata Ubiquitous in Speech/Speaker Recognition/Verification Suitable for modelling phenomena which are dynamic.
Hidden Markov Models Fundamentals and applications to bioinformatics.
Lecture 15 Hidden Markov Models Dr. Jianjun Hu mleg.cse.sc.edu/edu/csce833 CSCE833 Machine Learning University of South Carolina Department of Computer.
Apaydin slides with a several modifications and additions by Christoph Eick.
INTRODUCTION TO Machine Learning 3rd Edition
… Hidden Markov Models Markov assumption: Transition model:
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
HMM-BASED PATTERN DETECTION. Outline  Markov Process  Hidden Markov Models Elements Basic Problems Evaluation Optimization Training Implementation 2-D.
Lecture 6, Thursday April 17, 2003
Hidden Markov Model 11/28/07. Bayes Rule The posterior distribution Select k with the largest posterior distribution. Minimizes the average misclassification.
Hidden Markov Models I Biology 162 Computational Genetics Todd Vision 14 Sep 2004.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Hidden Markov Models K 1 … 2. Outline Hidden Markov Models – Formalism The Three Basic Problems of HMMs Solutions Applications of HMMs for Automatic Speech.
Forward-backward algorithm LING 572 Fei Xia 02/23/06.
1 Hidden Markov Model Instructor : Saeed Shiry  CHAPTER 13 ETHEM ALPAYDIN © The MIT Press, 2004.
Chapter 3 (part 3): Maximum-Likelihood and Bayesian Parameter Estimation Hidden Markov Model: Extension of Markov Chains All materials used in this course.
Doug Downey, adapted from Bryan Pardo,Northwestern University
Hidden Markov Models David Meir Blei November 1, 1999.
Hidden Markov models Sushmita Roy BMI/CS 576 Oct 16 th, 2014.
Learning HMM parameters Sushmita Roy BMI/CS 576 Oct 21 st, 2014.
INTRODUCTION TO Machine Learning ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Fall 2001 EE669: Natural Language Processing 1 Lecture 9: Hidden Markov Models (HMMs) (Chapter 9 of Manning and Schutze) Dr. Mary P. Harper ECE, Purdue.
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
1 Markov Chains. 2 Hidden Markov Models 3 Review Markov Chain can solve the CpG island finding problem Positive model, negative model Length? Solution:
Combined Lecture CS621: Artificial Intelligence (lecture 25) CS626/449: Speech-NLP-Web/Topics-in- AI (lecture 26) Pushpak Bhattacharyya Computer Science.
Ch10 HMM Model 10.1 Discrete-Time Markov Process 10.2 Hidden Markov Models 10.3 The three Basic Problems for HMMS and the solutions 10.4 Types of HMMS.
HMM Hidden Markov Model Hidden Markov Model. CpG islands CpG islands In human genome, CG dinucleotides are relatively rare In human genome, CG dinucleotides.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 21- Forward Probabilities and Robotic Action Sequences.
THE HIDDEN MARKOV MODEL (HMM)
Fundamentals of Hidden Markov Model Mehmet Yunus Dönmez.
Hidden Markov Models Yves Moreau Katholieke Universiteit Leuven.
Hidden Markov Models Usman Roshan CS 675 Machine Learning.
1 CS 552/652 Speech Recognition with Hidden Markov Models Winter 2011 Oregon Health & Science University Center for Spoken Language Understanding John-Paul.
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2006 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
Pattern Recognition and Machine Learning-Chapter 13: Sequential Data
1 Hidden Markov Model Observation : O1,O2,... States in time : q1, q2,... All states : s1, s2,... Si Sj.
Hidden Markov Models (HMMs) Chapter 3 (Duda et al.) – Section 3.10 (Warning: this section has lots of typos) CS479/679 Pattern Recognition Spring 2013.
Hidden Markov Models (HMMs) –probabilistic models for learning patterns in sequences (e.g. DNA, speech, weather, cards...) (2 nd order model)
1 Hidden Markov Models Hsin-min Wang References: 1.L. R. Rabiner and B. H. Juang, (1993) Fundamentals of Speech Recognition, Chapter.
1 Hidden Markov Model Observation : O1,O2,... States in time : q1, q2,... All states : s1, s2,..., sN Si Sj.
Hidden Markov Model Parameter Estimation BMI/CS 576 Colin Dewey Fall 2015.
Hidden Markov Models. A Hidden Markov Model consists of 1.A sequence of states {X t |t  T } = {X 1, X 2,..., X T }, and 2.A sequence of observations.
Data-Intensive Computing with MapReduce Jimmy Lin University of Maryland Thursday, March 14, 2013 Session 8: Sequence Labeling This work is licensed under.
Definition of the Hidden Markov Model A Seminar Speech Recognition presentation A Seminar Speech Recognition presentation October 24 th 2002 Pieter Bas.
Other Models for Time Series. The Hidden Markov Model (HMM)
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
Hidden Markov Models HMM Hassanin M. Al-Barhamtoshy
MACHINE LEARNING 16. HMM. Introduction Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2  Modeling dependencies.
Hidden Markov Models BMI/CS 576
Hidden Markov Model LR Rabiner
Presentation transcript:

1 Hidden Markov Model Xiaole Shirley Liu STAT115, STAT215

2 Outline Markov Chain Hidden Markov Model –Observations, hidden states, initial, transition and emission probabilities Three problems –Pb(observations): forward, backward procedure –Infer hidden states: forward-backward, Viterbi –Estimate parameters: Baum-Welch

3 iid process iid: independently and identically distributed –Events are not correlated to each other –Current event has no predictive power of future event –E.g. Pb(girl | boy) = Pb(girl), Pb(coin H | H) = Pb(H) Pb(dice 1 | 5) = pb(1)

4 Discrete Markov Chain Discrete Markov process –Distinct states: S 1, S 2, …S n –Regularly spaced discrete times: t = 1, 2,… –Markov chain: future state only depends on present state, but not the path to get here –a ij transition probability

5 Markov Chain Example 1 States: exam grade 1 – Pass, 2 – Fail Discrete times: exam #1, #2, # 3, … State transition probability Given PPPFFF, pb of pass in the next exam

6 Markov Chain Example 2 States: 1 – rain; 2 – cloudy; 3 – sunny Discrete times: day 1, 2, 3, … State transition probability Given 3 at t=1

7 Markov Chain Example 3 States: fair coin F, unfair (biased) coin B Discrete times: flip 1, 2, 3, … Initial probability:  F = 0.6,  B = 0.4 Transition probability Prob(FFBBFFFB) FB

8 Hidden Markov Model Coin toss example Coin transition is a Markov chain Probability of H/T depends on the coin used Observation of H/T is a hidden Markov chain (coin state is hidden)

9 Hidden Markov Model Elements of an HMM (coin toss) –N, the number of states (F / B) –M, the number of distinct observation (H / T) –A = {a ij } state transition probability –B = {b j (k)} emission probability –  ={  i } initial state distribution  F = 0.4,  B = 0.6

10 HMM Applications Stock market: bull/bear market hidden Markov chain, stock daily up/down observed, depends on big market trend Speech recognition: sentences & words hidden Markov chain, spoken sound observed (heard), depends on the words Digital signal processing: source signal (0/1) hidden Markov chain, arrival signal fluctuation observed, depends on source Bioinformatics!!

11 Basic Problems for HMM 1.Given, how to compute P(O| ) observing sequence O = O 1 O 2 …O T Probability of observing HTTHHHT … Forward procedure, backward procedure 2.Given observation sequence O = O 1 O 2 …O T and, how to choose state sequence Q = q 1 q 2 …q t What is the hidden coin behind each flip Forward-backward, Viterbi 3.How to estimate =(A,B,  ) so as to maximize P(O| ) How to estimate coin parameters Baum-Welch (Expectation maximization)

12 Problem 1: P(O| ) Suppose we know the state sequence Q –O = HTTHHHT –Q = FFBFFBB –Q = BFBFBBB Each given path Q has a probability for O

13 Problem 1: P(O| ) What is the prob of this path Q? –Q = FFBFFBB –Q = BFBFBBB Each given path Q has its own probability

14 Problem 1: P(O| ) Therefore, total pb of O = HTTHHHT Sum over all possible paths Q: each Q with its own pb multiplied by the pb of O given Q For path of N long and T hidden states, there are T N paths, unfeasible calculation

15 Solution to Prob1: Forward Procedure Use dynamic programming Summing at every time point Keep previous subproblem solution to speed up current calculation

16 Forward Procedure Coin toss, O = HTTHHHT Initialization –Pb of seeing H 1 from F 1 or B 1 H T T H … B F

17 Forward Procedure Coin toss, O = HTTHHHT Initialization Induction –Pb of seeing T 2 from F 2 or B 2 F 2 could come from F 1 or B 1 Each has its pb, add them up H T T H … + B B F + F

18 Forward Procedure Coin toss, O = HTTHHHT Initialization Induction H T T H … + B B F + F

19 Forward Procedure Coin toss, O = HTTHHHT Initialization Induction H T T H … + B + B + + BB FF + F + F

20 Forward Procedure Coin toss, O = HTTHHHT Initialization Induction Termination H T T H … + B + B + + BB FF + F + F

21 Solution to Prob1: Backward Procedure Coin toss, O = HTTHHHT Initialization Pb of coin to see certain flip after it...H H H T B F

22 Backward Procedure Coin toss, O = HTTHHHT Initialization Induction Pb of coin to see certain flip after it

23 Backward Procedure Coin toss, O = HTTHHHT Initialization Induction...H H H T? + + B F

24 Backward Procedure Coin toss, O = HTTHHHT Initialization Induction...H H H T B B + + B FF F

25 Backward Procedure Coin toss, O = HTTHHHT Initialization Induction Termination Both forward and backward could be used to solve problem 1, which should give identical results

26 Solution to Problem 2 Forward-Backward Procedure First run forward and backward separately Keep track of the scores at every point Coin toss –α: pb of this coin for seeing all the flips now and before –β: pb of this coin for seeing all the flips after HTTHHHT α 1 (F)α 2 (F)α 3 (F)α 4 (F)α 5 (F)α 6 (F)α 7 (F) α 1 (B)α 2 (B)α 3 (B)α 4 (B)α 5 (B)α 6 (B)α 7 (B) β 1 (F)β 2 (F)β 3 (F)β 4 (F)β 5 (F)β 6 (F)β 7 (F) β 1 (B)β 2 (B)β 3 (B)β 4 (B)β 5 (B)β 6 (B)β 7 (B)

27 Solution to Problem 2 Forward-Backward Procedure Coin toss Gives probabilistic prediction at every time point Forward-backward maximizes the expected number of correctly predicted states (coins)

28 Solution to Problem 2 Viterbi Algorithm Report the path that is most likely to give the observations Initiation Recursion Termination Path (state sequence) backtracking

29 Viterbi Algorithm Observe: HTTHHHT Initiation

30 Viterbi Algorithm H T T H F B

31 Viterbi Algorithm Observe: HTTHHHT Initiation Recursion Max instead of +, keep track path

32 Viterbi Algorithm Max instead of +, keep track of path Best path (instead of all path) up to here H T T H FF BB

33 Viterbi Algorithm Observe: HTTHHHT Initiation Recursion Max instead of +, keep track path

34 Viterbi Algorithm Max instead of +, keep track of path Best path (instead of all path) up to here H T T H FF BB F B F B

35 Viterbi Algorithm Terminate, pick state that gives final best δ score, and backtrack to get path H T T H BFBB most likely to give HTTH FF BB F B F BBB F B

36 Solution to Problem 3 No optimal way to do this, so find local maximum Baum-Welch algorithm (similar to expectation-maximization) –Random initialize =(A,B,  ) –Run forward-backward based on and O –Update =(A,B,  )  : % of F vs B on forward-backward path A: frequency of F/B transition on the path B: frequency of H/T emitted by F/B

Coin flip without parameters HTHTHTHTHHTTHTHTHTHTHTHHTHTT THTHHHHHTHHHHHHHHHTHHHHHHT HTHTHTHHTHHTTTHTHTHTHTTHTHHT HTTTHTTHTTTHTTHTHTTTHTTTTHTTT 37

HMM in Bioinformatics Gene prediction Sequence motif finding Protein structure prediction ChIP-chip peak calling Chromatin domains Nucleosome positioning on tiling arrays Copy number variation 38

39 Summary Markov Chain Hidden Markov Model –Observations, hidden states, initial, transition and emission probabilities Three problems –Pb(observations): forward, backward procedure (give same results) –Infer hidden states: forward-backward (pb prediction at each state), Viterbi (best path) –Estimate parameters: Baum-Welch