HMM : Viterbi algorithm - a toy example

Similar documents
HMM : Viterbi algorithm - a toy example

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

CISC 889 Bioinformatics (Spring 2004) Hidden Markov Models (II)

CSCE 471/871 Lecture 3: Markov Chains and

Markov Chains and Hidden Markov Models. COMP 571 Luay Nakhleh, Rice University

Lecture 9. Intro to Hidden Markov Models (finish up)

Hidden Markov Models. Three classic HMM problems

11.3 Decoding Algorithm

Hidden Markov Models for biological sequence analysis

Introduction to Hidden Markov Models for Gene Prediction ECE-S690

Hidden Markov Models for biological sequence analysis I

Hidden Markov Models. x 1 x 2 x 3 x K

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

Multiple Sequence Alignment using Profile HMM

An Introduction to Bioinformatics Algorithms Hidden Markov Models

Computational Genomics and Molecular Biology, Fall

STA 4273H: Statistical Machine Learning

An Introduction to Bioinformatics Algorithms Hidden Markov Models

Machine Learning & Data Mining Caltech CS/CNS/EE 155 Hidden Markov Models Last Updated: Feb 7th, 2017

Page 1. References. Hidden Markov models and multiple sequence alignment. Markov chains. Probability review. Example. Markovian sequence

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

Pair Hidden Markov Models

Hidden Markov Models

STA 414/2104: Machine Learning

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

L23: hidden Markov models

Example: The Dishonest Casino. Hidden Markov Models. Question # 1 Evaluation. The dishonest casino model. Question # 3 Learning. Question # 2 Decoding

Hidden Markov Models

Hidden Markov Models. Ivan Gesteira Costa Filho IZKF Research Group Bioinformatics RWTH Aachen Adapted from:

Introduction to Machine Learning CMU-10701

HIDDEN MARKOV MODELS

Markov Chains and Hidden Markov Models. = stochastic, generative models

Graphical Models Seminar

6.047/6.878/HST.507 Computational Biology: Genomes, Networks, Evolution. Lecture 05. Hidden Markov Models Part II

Human Mobility Pattern Prediction Algorithm using Mobile Device Location and Time Data

HMM: Parameter Estimation

Stephen Scott.

Hidden Markov Models (HMMs) and Profiles

Hidden Markov models in population genetics and evolutionary biology

10. Hidden Markov Models (HMM) for Speech Processing. (some slides taken from Glass and Zue course)

Hidden Markov Models. x 1 x 2 x 3 x K

Basic math for biology

O 3 O 4 O 5. q 3. q 4. Transition

Numerically Stable Hidden Markov Model Implementation

1 Hidden Markov Models

order is number of previous outputs

Hidden Markov Models. based on chapters from the book Durbin, Eddy, Krogh and Mitchison Biological Sequence Analysis via Shamir s lecture notes

Hidden Markov Models The three basic HMM problems (note: change in notation) Mitch Marcus CSE 391

Hidden Markov Models NIKOLAY YAKOVETS

1 What is a hidden Markov model?

Multiscale Systems Engineering Research Group

Hidden Markov Models

HMMs and biological sequence analysis

Statistical Machine Learning Methods for Bioinformatics II. Hidden Markov Model for Biological Sequences

Hidden Markov Models. Main source: Durbin et al., Biological Sequence Alignment (Cambridge, 98)

Statistical Machine Learning Methods for Biomedical Informatics II. Hidden Markov Model for Biological Sequences

Comparative Gene Finding. BMI/CS 776 Spring 2015 Colin Dewey

Stephen Scott.

6 Markov Chains and Hidden Markov Models

Cheng Soon Ong & Christian Walder. Canberra February June 2018

Hidden Markov Models (I)

Lab 3: Practical Hidden Markov Models (HMM)

Hidden Markov Modelling

Lecture 7 Sequence analysis. Hidden Markov Models

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

Hidden Markov Models (Part 1)

Hidden Markov Models and Their Applications in Biological Sequence Analysis

Today s Lecture: HMMs

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

Hidden Markov Models

1. Markov models. 1.1 Markov-chain

Hidden Markov Models. Hosein Mohimani GHC7717

Hidden Markov Models and Gaussian Mixture Models

CS6220 Data Mining Techniques Hidden Markov Models, Exponential Families, and the Forward-backward Algorithm

Hidden Markov Models. Ron Shamir, CG 08

University of Cambridge. MPhil in Computer Speech Text & Internet Technology. Module: Speech Processing II. Lecture 2: Hidden Markov Models I

Hidden Markov Models. music recognition. deal with variations in - pitch - timing - timbre 2

ROBI POLIKAR. ECE 402/504 Lecture Hidden Markov Models IGNAL PROCESSING & PATTERN RECOGNITION ROWAN UNIVERSITY

Giri Narasimhan. CAP 5510: Introduction to Bioinformatics. ECS 254; Phone: x3748

Part of Speech Tagging: Viterbi, Forward, Backward, Forward- Backward, Baum-Welch. COMP-599 Oct 1, 2015

CAP 5510: Introduction to Bioinformatics CGS 5166: Bioinformatics Tools. Giri Narasimhan

Bioinformatics Introduction to Hidden Markov Models Hidden Markov Models and Multiple Sequence Alignment

CSCE 478/878 Lecture 9: Hidden. Markov. Models. Stephen Scott. Introduction. Outline. Markov. Chains. Hidden Markov Models. CSCE 478/878 Lecture 9:

Math 350: An exploration of HMMs through doodles.

Linear Dynamical Systems

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

Temporal Modeling and Basic Speech Recognition

Implementation of EM algorithm in HMM training. Jens Lagergren

A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models

Speech Recognition HMM

Parametric Models Part III: Hidden Markov Models

Lecture 11: Hidden Markov Models

EECS730: Introduction to Bioinformatics

R. Durbin, S. Eddy, A. Krogh, G. Mitchison: Biological sequence analysis. Cambridge University Press, ISBN (Chapter 3)

CS 136a Lecture 7 Speech Recognition Architecture: Training models with the Forward backward algorithm

Hidden Markov Models

Hidden Markov Models. x 1 x 2 x 3 x N

Hidden Markov Models

Hidden Markov Models: All the Glorious Gory Details

Robert Collins CSE586 CSE 586, Spring 2015 Computer Vision II

Transcription:

MM : Viterbi algorithm - a toy example 0.5 0.5 0.5 A 0.2 A 0.3 0.5 0.6 C 0.3 C 0.2 G 0.3 0.4 G 0.2 T 0.2 T 0.3 et's consider the following simple MM. This model is composed of 2 states, (high GC content) and (low GC content). We can for example consider that state characterizes coding DNA while characterizes a non-coding DNA. The model can then be used to predict the region of coding DNA from a given sequence. Sources: For the theory, see Durbin et al (1998); For the example, see Borodovsky & Ekisheva (2006), pp 80-81

MM : Viterbi algorithm - a toy example 0.5 0.5 0.5 A 0.2 A 0.3 0.5 0.6 C 0.3 C 0.2 G 0.3 0.4 G 0.2 T 0.2 T 0.3 Consider the sequence S= GGCACTGAA There are several paths through the hidden states ( and ) that lead to the given sequence. Example: P = The probability of the MM to produce sequence S through the path P is: p = p (0) * p (G) * p * p (G) * p * p (C) *... = 0.5 * 0.2 * 0.6 * 0.2 * 0.4 * 0.3 *... =...

MM : Viterbi algorithm - a toy example 0.5 0.5 0.5 A 0.2 A 0.3 0.5 0.6 C 0.3 C 0.2 G 0.3 0.4 G 0.2 T 0.2 T 0.3 GGCACTGAA There are several paths through the hidden states ( and ) that lead to the given sequence, but they do not have the same probability. The Viterbi algorithm is a dynamical programming algorithm that allows us to compute the most probable path. Its principle is similar to the DP programs used to align 2 sequences (i.e. Needleman-Wunsch) Source: Borodovsky & Ekisheva, 2006

MM : Viterbi algorithm - a toy example 0.5 0.5 Viterbi algorithm: principle 0.5 A 0.2 A 0.3 0.5 0.6 C 0.3 C 0.2 G 0.3 0.4 G 0.2 T 0.2 T 0.3 G G C A C T G A A The probability of the most probable path ending in state k with observation "i" is p l (i, x) = e l ( i)max k ( ) p k ( j, x "1).p kl probability to observe element i in state l probability of the most probable path ending at position x in state k with element j probability of the transition from state l to state k

MM : Viterbi algorithm - a toy example 0.5 0.5 Viterbi algorithm: principle 0.5 A 0.2 A 0.3 0.5 0.6 C 0.3 C 0.2 G 0.3 0.4 G 0.2 T 0.2 T 0.3 G G C A C T G A A The probability of the most probable path ending in state k with observation "i" is p l (i, x) = e l ( i)max In our example, the probability of the most probable path ending in state with observation "A" at the 4th position is: ( ) p (A,4) = e (A)max p (C,3) p, p (C,3) p We can thus compute recursively (from the first to the last element of our sequence) the probability of the most probable path. k ( ) p k ( j, x "1).p kl

MM : Viterbi algorithm - a toy example A -2.322 A.737-0.737 C.737 C -2.322 G.737.322 G -2.322 T -2.322 T.737 Remark: for the calculations, it is convenient to use the log of the probabilities (rather than the probabilities themselves). Indeed, this allows us to compute sums instead of products, which is more efficient and accurate. We used here log 2 (p).

MM : Viterbi algorithm - a toy example A -2.322 C.737 G.737 T -2.322.322 A.737 C -2.322 G -2.322 T.737-0.737 GGCACTGAA Probability (in log 2 ) that G at the first position was emitted by state Probability (in log 2 ) that G at the first position was emitted by state p (G,1) =.737 = -2.737 p (G,1) = -2.322 = -3.322

MM : Viterbi algorithm - a toy example A -2.322 C.737 G.737 T -2.322.322 A.737 C -2.322 G -2.322 T.737-0.737 GGCACTGAA Probability (in log 2 ) that G at the 2nd position was emitted by state Probability (in log 2 ) that G at the 2nd position was emitted by state p (G,2) =.737 + max (p (G,1)+p, p (G,1)+p ) =.737 + max (-2.737, -3.322.322) = -5.474 (obtained from p (G,1)) p (G,2) = -2.322 + max (p (G,1)+p, p (G,1)+p ) = -2.322 + max (-2.737, -3.322-0.737) = -6.059 (obtained from p (G,1))

MM : Viterbi algorithm - a toy example A -2.322 C.737 G.737 T -2.322.322 A.737 C -2.322 G -2.322 T.737-0.737 GGCACTGAA G G C A C T G A A -2.73-5.47-8.21 1.53 4.01... -25.65-3.32-6.06-8.79 0.94 4.01... -24.49 We then compute iteratively the probabilities p (i,x) and p (i,x) that nucleotide i at position x was emitted by state or, respectively. The highest probability obtained for the nucleotide at the last position is the probability of the most probable path. This path can be retrieved by back-tracking.

MM : Viterbi algorithm - a toy example A -2.322 C.737 G.737 T -2.322.322 A.737 C -2.322 G -2.322 T.737-0.737 GGCACTGAA back-tracking (= finding the path which corresponds to the highest probability, -24.49) G G C A C T G A A -2.73-5.47-8.21 1.53 4.01... -25.65-3.32-6.06-8.79 0.94 4.01... -24.49 The most probable path is: Its probability is 2-24.49 = 4.25E-8 (remember that we used log 2 (p))

MM : Viterbi algorithm - a toy example Remarks The Viterbi algorithm is used to compute the most probable path (as well as its probability). It requires knowledge of the parameters of the MM model and a particular output sequence and it finds the state sequence that is most likely to have generated that output sequence. It works by finding a maximum over all possible state sequences. In sequence analysis, this method can be used for example to predict coding vs non-coding sequences. In fact there are often many state sequences that can produce the same particular output sequence, but with different probabilities. It is possible to calculate the probability for the MM model to generate that output sequence by doing the summation over all possible state sequences. This also can be done efficiently using the Forward algorithm, which is also a dynamical programming algorithm. In sequence analysis, this method can be used for example to predict the probability that a particular DNA region match the MM motif (i.e. was emitted by the MM model).

MM : Viterbi algorithm - a toy example Remarks To create a MM model (i.e. find the most likely set of state transition and output probabilities of each state), we need a set of (related/aligned) sequences. No tractable algorithm is known for solving this problem exactly, but a local maximum likelihood can be derived efficiently using the Baum-Welch algorithm or the Baldi-Chauvin algorithm. The Baum-Welch algorithm is an example of a forward-backward algorithm, and is a special case of the Expectation-maximization algorithm. For more details: see Durbin et al (1998) MMER The UMMER3 package contains a set of programs (developed by S. Eddy) to build MM models (from a set of aligned sequences) and to use MM models (to align sequences or to find sequences in databases). These programs are available at the Mobyle plateform (http://mobyle.pasteur.fr/cgi-bin/mobyleportal/portal.py)