【math】Hiden Markov Model 隐马尔可夫模型了解
创始人
2024-01-21 05:39:26
0

文章目录

  • Introduction to Hidden Markov Model
    • Introduction
      • Markov chain
      • Hidden Markov Model(HMM)
    • Three Questions
      • Q1: evaluate problem -- Forward algorithm
      • Q2: decode problem -- Viterbi algorithm
      • Q3: learn problem -- Baum-Welch algorithm
    • Application

Introduction to Hidden Markov Model

Introduction

  • Markov chains were first introduced in 1906 by Andrey Markov
  • HMM was developed by L. E. Baum and coworkers in the 1960s
  • HMM is simplest dynamic Bayesian network and a directed graphic model
  • Application: speech recognition, PageRank(Google), DNA analysis, …

Markov chain

A Markov chain is “a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event”.

在这里插入图片描述
Space or time can be either discrete(𝑋_𝑡:t=0, 1, 2,…) or continuous(𝑋_𝑡:t≥0). (we will focus on Markov chains in discrete space an time)

Example for Markov chain:

  • transition matrix 𝑄 :
  • 5-step transition matrix is 𝑄^5 :
    在这里插入图片描述

Hidden Markov Model(HMM)

HMM is a statistical Markov model in which the system being modeled is assumed to be a Markov process with unobserved (i.e. hidden) states.

State: x = (x1, x2, x3) ; 
Observation: y = (y1, y2, y3);
Transition matrix: A = (aij); 
Emission matrix: B = (bij)

在这里插入图片描述

Example:
在这里插入图片描述
在这里插入图片描述

Three Questions

  • Given the model 𝜆=[𝐴, 𝐵,𝜋], how to calculate the probability of producing the observation 𝒚={𝑦1_11​,𝑦2_22​,…,𝑦𝑛_𝑛n​ | 𝑦𝑖_𝑖i​∈𝑂}? In other words, how to evaluate the matching degree between the model and the observation ?
  • Given the model 𝜆=[𝐴, 𝐵,𝜋] and the observation 𝒚={𝑦1_11​,𝑦2_22​,…,𝑦𝑛_𝑛n​| 𝑦𝑖_𝑖i​∈𝑂}, how to find most probable state 𝒙={𝑥1_11​,𝑥2_22​,…,𝑥𝑛_𝑛n​ |𝑥𝑖_𝑖i​∈𝑆} ? In other words, how to infer the hidden state from the observation ?
  • Given the observation 𝒚={𝑦1_11​,𝑦2_22​,…,𝑦𝑛_𝑛n​ | 𝑦𝑖_𝑖i​∈𝑂}, how to adjust model parameters 𝜆=[𝐴, 𝐵,𝜋] to maximize to the probability 𝑃(𝒚│𝜆) ? In other words, how to train the model to describe the observation more accurately ?

Q1: evaluate problem – Forward algorithm

Q1: how to evaluate the matching degree between the model and the observation ? ( forward algorithm)

  • the probability of observing event 𝑦1_11​: 𝑃𝑖0_{𝑖0}i0​ = 𝑃𝑖_𝑖i​ (𝑂=𝑦1{_1}1​) = 𝜋𝑖𝑏1𝑖_{𝑖}𝑏_{1𝑖}i​b1i​
  • the probability of observing event 𝑦𝑗+1_{𝑗+1}j+1​ (𝑗≥1): 𝑃𝑖𝑗_𝑖𝑗i​j=𝑏𝑗,𝑖+1_{𝑗,𝑖+1}j,i+1​ ∑𝑘_𝑘k​𝑃𝑖,𝑗−1_{𝑖,𝑗−1}i,j−1​ 𝑎𝑖𝑗_{𝑖𝑗}ij​
  • 𝑃(𝒚)=∑𝑘_{𝑘}k​ 𝑃𝑖𝑗_{𝑖𝑗}ij​∗𝑎𝑗0_{𝑗0}j0​
    在这里插入图片描述

Q2: decode problem – Viterbi algorithm

Q2: how to infer the hidden state from the observation ? (Viterbi algorithm)

Observation 𝒚=(𝑦1_11​, 𝑦2_22​,…, 𝑦𝑇_𝑇T​), initial prob. 𝝅=(𝜋1_11​,𝜋2_22​,…, 𝜋𝐾_𝐾K​), transition matrix 𝐴, emission matrix 𝐵.
在这里插入图片描述
Viterbi algorithm(optimal solution) backtracking method; It retains the optimal solution of each choice in the previous step and finds the optimal selection path through the backtracking method.

Example:

  • The observation 𝒚={“′Normal′, ′Cold′, ′Dizzy′” } , 𝜆=[𝐴, 𝐵,𝜋], the hidden state 𝒙={𝑥1_11​,𝑥2_22​,𝑥3_33​}= ?
    在这里插入图片描述 在这里插入图片描述
    在这里插入图片描述

Q3: learn problem – Baum-Welch algorithm

Q3: how to train the model to describe the observation more accurately ? (Baum-Welch algorithm)

The Baum–Welch algorithm uses the well known EM algorithm to find the maximum likelihood estimate of the parameters of a hidden Markov model given a set of observed feature vectors.
在这里插入图片描述
在这里插入图片描述
Baum–Welch algorithm(forward-backward alg.) It approximates the optimal parameters through iteration.

在这里插入图片描述

  • (1) Likelihood function :
    𝑙𝑜𝑔𝑃(Y,𝐼|𝜆)
  • (2) Expectation of EM algorithm:
    𝑄(𝜆,𝜆 ̂ )= ∑𝐼_𝐼I​ 𝑙𝑜𝑔𝑃(𝑌,𝐼|𝜆)𝑃(𝑌,𝐼|𝜆 ̂ )
  • (3) *Maximization of EM algorithm:
    max 𝑄(𝜆,𝜆 ̂ )

use Lagrangian multiplier method and take the partial derivative of Lagrangian funcition。

Application

CpG island:

  • In the human genome wherever the dinucleotide CG occurs, the C nucleotide is typically chemically modified by methylation.
  • around the promoters or ‘start’ regions
  • CpG is typically a few hundred to a few thousand bases long.
    在这里插入图片描述 在这里插入图片描述
    three questions: of CpG island:
  • Given the model of distinguished the CpG island, how to calculate the probability of the observation sequence ?
  • Given a short stretch of genomic sequence, how would we decide if it comes from a CpG island or not ?
  • Given a long piece of sequence, how would we find the CpG islands in it?
    在这里插入图片描述

reference:

  • Markov chain Defination
  • A Revealing Introduction to Hidden Markov Models
  • Top 10 Algorithms in Data Mining
  • An Introduction to Hidden Markov Models for Biological Sequences
  • python-hmmlearn-example
  • Viterbi algorithm
  • Baum-Welch blog
  • Biological Sequence Analysis. Probabilistic Models of Proteins and Nucleic Acids. R. Durbin, S. Eddy, A. Krogh and G. Mitchison

未完待续…

相关内容

热门资讯

喜欢穿一身黑的男生性格(喜欢穿... 今天百科达人给各位分享喜欢穿一身黑的男生性格的知识,其中也会对喜欢穿一身黑衣服的男人人好相处吗进行解...
发春是什么意思(思春和发春是什... 本篇文章极速百科给大家谈谈发春是什么意思,以及思春和发春是什么意思对应的知识点,希望对各位有所帮助,...
网络用语zl是什么意思(zl是... 今天给各位分享网络用语zl是什么意思的知识,其中也会对zl是啥意思是什么网络用语进行解释,如果能碰巧...
为什么酷狗音乐自己唱的歌不能下... 本篇文章极速百科小编给大家谈谈为什么酷狗音乐自己唱的歌不能下载到本地?,以及为什么酷狗下载的歌曲不是...
华为下载未安装的文件去哪找(华... 今天百科达人给各位分享华为下载未安装的文件去哪找的知识,其中也会对华为下载未安装的文件去哪找到进行解...
怎么往应用助手里添加应用(应用... 今天百科达人给各位分享怎么往应用助手里添加应用的知识,其中也会对应用助手怎么添加微信进行解释,如果能...
家里可以做假山养金鱼吗(假山能... 今天百科达人给各位分享家里可以做假山养金鱼吗的知识,其中也会对假山能放鱼缸里吗进行解释,如果能碰巧解...
一帆风顺二龙腾飞三阳开泰祝福语... 本篇文章极速百科给大家谈谈一帆风顺二龙腾飞三阳开泰祝福语,以及一帆风顺二龙腾飞三阳开泰祝福语结婚对应...
四分五裂是什么生肖什么动物(四... 本篇文章极速百科小编给大家谈谈四分五裂是什么生肖什么动物,以及四分五裂打一生肖是什么对应的知识点,希...
美团联名卡审核成功待激活(美团... 今天百科达人给各位分享美团联名卡审核成功待激活的知识,其中也会对美团联名卡审核未通过进行解释,如果能...