Hidden Markov Models Usman Roshan BNFO 601.

Slides:



Advertisements
Similar presentations
. Lecture #8: - Parameter Estimation for HMM with Hidden States: the Baum Welch Training - Viterbi Training - Extensions of HMM Background Readings: Chapters.
Advertisements

. Inference and Parameter Estimation in HMM Lecture 11 Computational Genomics © Shlomo Moran, Ydo Wexler, Dan Geiger (Technion) modified by Benny Chor.
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.
Rolling Dice Data Analysis - Hidden Markov Model Danielle Tan Haolin Zhu.
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.
Bioinformatics Hidden Markov Models. Markov Random Processes n A random sequence has the Markov property if its distribution is determined solely by its.
Hidden Markov Models Eine Einführung.
Hidden Markov Models.
 CpG is a pair of nucleotides C and G, appearing successively, in this order, along one DNA strand.  CpG islands are particular short subsequences in.
Hidden Markov Models Modified from:
Hidden Markov Models Theory By Johan Walters (SR 2003)
Hidden Markov Models Fundamentals and applications to bioinformatics.
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
HMM for CpG Islands Parameter Estimation For HMM Maximum Likelihood and the Information Inequality Lecture #7 Background Readings: Chapter 3.3 in the.
. Learning Hidden Markov Models Tutorial #7 © Ilan Gronau. Based on original slides of Ydo Wexler & Dan Geiger.
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. Two learning scenarios 1.Estimation when the “right answer” is known Examples: GIVEN:a genomic region x = x 1 …x 1,000,000 where.
Hidden Markov Models. Decoding GIVEN x = x 1 x 2 ……x N We want to find  =  1, ……,  N, such that P[ x,  ] is maximized  * = argmax  P[ x,  ] We.
Hidden Markov Models Pairwise Alignments. Hidden Markov Models Finite state automata with multiple states as a convenient description of complex dynamic.
. Parameter Estimation and Relative Entropy Lecture #8 Background Readings: Chapters 3.3, 11.2 in the text book, Biological Sequence Analysis, Durbin et.
Hidden Markov Models Lecture 6, Thursday April 17, 2003.
Hidden Markov Models I Biology 162 Computational Genetics Todd Vision 14 Sep 2004.
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
. Parameter Estimation For HMM Background Readings: Chapter 3.3 in the book, Biological Sequence Analysis, Durbin et al., 2001.
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
S. Maarschalkerweerd & A. Tjhang1 Parameter estimation for HMMs, Baum-Welch algorithm, Model topology, Numerical stability Chapter
. Class 5: HMMs and Profile HMMs. Review of HMM u Hidden Markov Models l Probabilistic models of sequences u Consist of two parts: l Hidden states These.
Hidden Markov Models K 1 … 2. Outline Hidden Markov Models – Formalism The Three Basic Problems of HMMs Solutions Applications of HMMs for Automatic Speech.
Hidden Markov Models Usman Roshan BNFO 601. Hidden Markov Models Alphabet of symbols: Set of states that emit symbols from the alphabet: Set of probabilities.
Bioinformatics Hidden Markov Models. Markov Random Processes n A random sequence has the Markov property if its distribution is determined solely by its.
Elze de Groot1 Parameter estimation for HMMs, Baum-Welch algorithm, Model topology, Numerical stability Chapter
Hidden Markov Models Usman Roshan BNFO 601. Hidden Markov Models Alphabet of symbols: Set of states that emit symbols from the alphabet: Set of probabilities.
Hidden Markov Models.
Doug Downey, adapted from Bryan Pardo,Northwestern University
Hidden Markov models Sushmita Roy BMI/CS 576 Oct 16 th, 2014.
Learning HMM parameters Sushmita Roy BMI/CS 576 Oct 21 st, 2014.
Hidden Markov Models Usman Roshan BNFO 601. Hidden Markov Models Alphabet of symbols: Set of states that emit symbols from the alphabet: Set of probabilities.
CS262 Lecture 5, Win07, Batzoglou Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
Dishonest Casino Let’s take a look at a casino that uses a fair die most of the time, but occasionally changes it to a loaded die. This model is 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:
. Parameter Estimation For HMM Lecture #7 Background Readings: Chapter 3.3 in the text book, Biological Sequence Analysis, Durbin et al.,  Shlomo.
. Parameter Estimation For HMM Lecture #7 Background Readings: Chapter 3.3 in the text book, Biological Sequence Analysis, Durbin et al., 2001.
Fundamentals of Hidden Markov Model Mehmet Yunus Dönmez.
H IDDEN M ARKOV M ODELS. O VERVIEW Markov models Hidden Markov models(HMM) Issues Regarding HMM Algorithmic approach to Issues of HMM.
Hidden Markov Models Yves Moreau Katholieke Universiteit Leuven.
Hidden Markov Models Usman Roshan CS 675 Machine Learning.
S. Salzberg CMSC 828N 1 Three classic HMM problems 2.Decoding: given a model and an output sequence, what is the most likely state sequence through the.
PGM 2003/04 Tirgul 2 Hidden Markov Models. Introduction Hidden Markov Models (HMM) are one of the most common form of probabilistic graphical models,
Expected accuracy sequence alignment Usman Roshan.
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
1 CS 552/652 Speech Recognition with Hidden Markov Models Winter 2011 Oregon Health & Science University Center for Spoken Language Understanding John-Paul.
Algorithms in Computational Biology11Department of Mathematics & Computer Science Algorithms in Computational Biology Markov Chains and Hidden Markov Model.
. Parameter Estimation and Relative Entropy Lecture #8 Background Readings: Chapters 3.3, 11.2 in the text book, Biological Sequence Analysis, Durbin et.
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2006 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
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.
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 BMI/CS 576
Hidden Markov Models - Training
Hidden Markov Models Part 2: Algorithms
Three classic HMM problems
Algorithms of POS Tagging
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.
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.
CSE 5290: Algorithms for Bioinformatics Fall 2009
Hidden Markov Models By Manish Shrivastava.
Presentation transcript:

Hidden Markov Models Usman Roshan BNFO 601

Hidden Markov Models Alphabet of symbols: Set of states that emit symbols from the alphabet: Set of probabilities State transition: Emission probabilities:

Loaded die problem

Loaded die automata aFL F L aFF aLL eF(i) eL(i) aLF

Loaded die problem Consider the following rolls: Observed : 21665261 Underlying die : FFLLFLLF What is the probability that the underlying path generated the observed sequence?

HMM computational problems Hidden sequence known Hidden sequence unknown Transition and emission probabilities known Model fully specified Viterbi to determine optimal hidden sequence Transition and emission probabilities unknown Maximum likelihood Expected maximization and also known as Baum-Welch

Probabilities unknown but hidden sequence known Akl: number of transitions from state k to l Ek(b): number of times state k emits symbol b

Probabilities known but hidden sequence unknown Problem: Given an HMM and a sequence of rolls, find the most probably underlying generating path. Let be the sequence of rolls. Let VF(i) denote the probability of the most probable path of that ends in state F. (Define VL(i) similarly.)

Probabilities known but hidden sequence unknown Initialize: Recurrence: for i=0..n-1

Probabilities and hidden sequence unknown Use Expected-Maximization algorithm (also known as EM algorithm) Very popular and many applications For HMMs also called Baum-Welch algorithm Outline: Start with random assignment to transition and emission probabilities Compute expected transition and emission probabilities using forward and backward procedures. Estimate actual transition and emission probabilities from expected values in previous step Go to step 2 if not converged

Sequence alignment Biological sequence analysis, Durbin et. al., 1998

Alignment HMM Input: seq1 and seq2 Hidden states M: match or mismatch X: gap in aligned seq1 Y: gap in aligned seq2 B: begin Emission probabilities pm: probability of match by M (pm=.6) pmm: probability of mismatch by M (1-pm) pgap: probability of gap by X or Y (equal to 1)

Alignment HMM Transition probabilities MX = MY = delta, MM=1-2delta-tau XX = eta, XM = 1-eta-tau, XY=0 YY = eta, YM = 1-eta-tau, YX=0 BM = 1-2delta-tau, BX=delta, BY=delta

Alignment HMM Viterbi Initialization B[i][j]=0 for 0<=i<=len(seq2), 0<=j<=len(seq1), B[0][[0]=1 M[i][j]=0 for 1<=i<=len(seq2), 1<=j<=len(seq1) X[0][0]=0, X[0][i]=0 for 1<=i<=len(seq1) X[1][0]=pgap*BX*B[0][0] X[i][0]=pgap*XX*X[i-1][0] for 2<=i<len(seq2) Y[0][0]=0, Y[j][0]=0 for 1<=j<=len(seq2) Y[0][1]=pgap*BY*B[0][0] Y[0][i]=pgap*YY*Y[0][i-1] for 2<=i<len(seq1) T[0][j]=‘L’, T[i][0]=‘U’

Alignment HMM Viterbi Recurrence: For 1<=i<=len(seq2), 1<=j<=len(seq1):

Alignment Viterbi HMM Continued from previous slide… if(M[i][j] >= X[i][j] AND M[i][j] >= Y[i][j]) T[i][j]=‘D’ else if(X[i][j] >= M[i][j] AND X[i][j]] >= Y[i][j]) T[i][j]=‘U’ else if(Y[i][j] >= M[i][j] AND Y[i][j] >= X[i][j]) T[i][j]=‘L’

HMM forward probabilities Consider the probability of all alignments of sequences X and Y under a given HMM. Let M(i,j) be the sum of the probabilities of all alignments of X1...i and Y1…j that end in match or mismatch. Then M(i,j) is given by We calculate X(i,j) and Y(i,j) in the same way. We call these forward probabilities: f(i,j) = M(i,j)+X(i,j)+Y(i,j)

HMM backward probabilities Similarly we can calculate backward probabilties M’(i,j). Define M’(i,j) as the sum of probabilities of all alignments of Xi..m and Yj..n such that Xi and and Yj are aligned to each other. The indices i and j start from m and n respectively and decrease These are also called backward probabilities. B(i,j)=M’(i,j)+X’(i,j)+Y’(i,j)

Baum Welch How do we calculate expected transition and emission probabilities? Consider the fair-loaded die problem. What is the expected transition of fair (F) to loaded (L)? To answer we have to count the number of times F transitions to L in all possible hidden sequences and multiply each by the probability of the hidden sequence

Baum Welch For example suppose input is 116 There are 8 possible hidden sequences What is the probability of all hidden sequences where F transitions to L between first and second emission What about second and third emission? What about all consecutive positions? What if we have more than one training sequence?

Baum Welch General formula for expected number of transitions from state k to l. General formula for expected number of emissions of b from state k. Equations from Durbin et. al., 1998

Baum Welch Initialize random values for all parameters Calculate forward and backward probabilities Calculate new model parameters Did the probabilities change by more than 0.001? If yes goto step 2. Otherwise stop.