【math】Hiden Markov Model 隐马尔可夫模型了解

news2024/10/3 0:50:58

文章目录

  • 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 _1 1,𝑦 2 _2 2,…,𝑦 𝑛 _𝑛 n | 𝑦 𝑖 _𝑖 i∈𝑂}? In other words, how to evaluate the matching degree between the model and the observation ?
  • Given the model 𝜆=[𝐴, 𝐵,𝜋] and the observation 𝒚={𝑦 1 _1 1,𝑦 2 _2 2,…,𝑦 𝑛 _𝑛 n| 𝑦 𝑖 _𝑖 i∈𝑂}, how to find most probable state 𝒙={𝑥 1 _1 1,𝑥 2 _2 2,…,𝑥 𝑛 _𝑛 n |𝑥 𝑖 _𝑖 i∈𝑆} ? In other words, how to infer the hidden state from the observation ?
  • Given the observation 𝒚={𝑦 1 _1 1,𝑦 2 _2 2,…,𝑦 𝑛 _𝑛 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 _1 1: 𝑃 𝑖 0 _{𝑖0} i0 = 𝑃 𝑖 _𝑖 i (𝑂=𝑦 1 {_1} 1) = 𝜋 𝑖 𝑏 1 𝑖 _{𝑖}𝑏_{1𝑖} ib1i
  • the probability of observing event 𝑦 𝑗 + 1 _{𝑗+1} j+1 (𝑗≥1): 𝑃 𝑖 𝑗 _𝑖𝑗 ij=𝑏 𝑗 , 𝑖 + 1 _{𝑗,𝑖+1} j,i+1 𝑘 _𝑘 k𝑃 𝑖 , 𝑗 − 1 _{𝑖,𝑗−1} i,j1 𝑎 𝑖 𝑗 _{𝑖𝑗} 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 _1 1, 𝑦 2 _2 2,…, 𝑦 𝑇 _𝑇 T), initial prob. 𝝅=(𝜋 1 _1 1,𝜋 2 _2 2,…, 𝜋 𝐾 _𝐾 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 _1 1,𝑥 2 _2 2,𝑥 3 _3 3}= ?
    在这里插入图片描述 在这里插入图片描述
    在这里插入图片描述

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

未完待续…

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/7211.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

重装Windows系统教程(U盘制作+重装系统)

一、U盘制作 找一个不用的U盘,大小建议在15G以上,因为后面要存储下载好的电脑系统。U盘在被制作成系统盘的时候会被格式化,注意使用前将有用的信息提前保存以免丢失。 第一步:用能够正常联网的电脑打开U盘制作网站,打开…

MySQL解决group by分组后未排序问题

MySQL解决group by分组后未排序问题一、遇见问题1、错误SQL2、正确SQL一、遇见问题 当我们要实现SQL分组后取第一条数据则需要进行排序结果作为子查询后分组 CREATE TABLE op_joke (id int(11) NOT NULL AUTO_INCREMENT,name1 varchar(255) DEFAULT NULL,name2 varchar(255) D…

Spring

Spring[TOC](Spring)1、概述1.1、优点1.2、组成2. IOC概述2.1 什么是IOC2.1.1 推导过程2.1.2 IOC本质2.2 HelloSpring2.2.1 导入Jar包2.2.2 编写代码2.2.2 思考2.3 IOC过程2.4 IOC 接口3. Bean 管理3.1 基于xml方式——set方法注入3.2 FactoryBean3.3 bean 作用域3.4 bean 生命…

mannose-Biotin|甘露糖-生物素|甘露糖-聚乙二醇-生物素|生物素-PEG-甘露糖

mannose-Biotin|甘露糖-生物素|甘露糖-聚乙二醇-生物素|生物素-PEG-甘露糖 PEG接枝修饰甘露糖,mannose-PEG-Biotin 甘露糖-聚乙二醇-生物素,生物素-PEG-甘露糖 中文名称:甘露糖-生物素 英文名称:mannose-Biotin 别称&#xff…

工具分享-Ajax Interceptor

前言 资源地址: https://gitee.com/LjLoveMlh/tech_share/raw/master/%E8%B5%84%E6%BA%90/Ajax%20Interceptor/1.3.1_011.zip 给大家分享个好东西 Ajax Intercepto 帮助开发,测试人员Mock数据,更快,更安全 解决的痛点&#xff1a…

Vue3+Vite3+Vant初体验及踩过的一些坑

需要帮人做移动端的几个页面,带表单那种,说最好能用vant做,于是边学边弄记录下。 首先用 npm create vitelatest 就报错了,于是默默看了眼node包版本比官网说的低,就先升级node,升级之后再运行一次命令 …

sketch入门选手如何避坑

Sketch它是为图标设计和界面设计而生的。它是一个优秀的人。UI一站式应用Sketch画布将是无限大小的,每层都支持多种填充模式。Sketch为您提供真正合作设计过程所需的所有工具。从早期创意到像素完美的艺术品,原型清晰,与开发人员交接。Sketch…

Flink1.15源码解析--选举

文章目录一、LeaderContender二、LeaderElectionService2.1、LeaderElectionService2.2、LeaderElectionEventHandler(竞选服务的事件处理类)三 、LeaderElectionDriver3.1、LeaderLatchListener角色说明LeaderContender(竞选者)需要选主的主体,比如dispatcher、res…

Linux 夺命连环11问你能答对几个?

朋友们,先来11个快问快答看看自己能答对8个吗? 1.如何查看一个文件的末尾50行? tail -n 50 file 2.如何查看文件中包含“error”的行 cat file | grep "error" 3.如何查看某端口号是否被占用? netstat -anp | gre…

图片水印怎么加?图片加水印方法分享

相信大家在日常生活中,都会在各个平台上分享自己拍摄的照片吧,但大家在收到网友的好评和点赞的同时,是不是会因为担心图片被别人转发或者是拿去做一些不好的事情而感到烦恼呢?其实要解决这个烦恼很简单,那就是给图片添…

点击化学(Click chemistry) 叠氮-PEG4-NHS/Biotin-PEG-N3/Azid/DBCO-EPG-NHS/DBCO-NH2

点击化学(Click chemistry),也称作链接化学、速配接合组合式化学。在药物开发、生物医用材料优化、生物分子标记与检测等诸多领域中有着较好的应用,已经成为最热门的研究领域之一。点击化学符合绿色化学的12项原则,具有…

stm32 笔记 IO 口点灯实验及 HAL 库使用

GPIO 概述 全称:general purpose intput output,通用输入输出接口。 顾名思义,既可作为输入框也可以作为输入口。 引脚不一定是 GPIO,有些引脚也作为复位或晶振等使用。 GPIO的八种工作模式 输入:浮空输入&#xf…

甘露糖-酰基|mannose-Hydrazide|酰基-PEG-甘露糖

甘露糖-酰基|mannose-Hydrazide|酰基-PEG-甘露糖 酰基(acyl group),是指有机或无机含氧酸去掉一个或多个羟基后剩下的原子团,通式为R-M(O)-。 酰基(acyl group)指的是有机或无机含氧酸去掉羟基后剩下的一价原子团,通式为R-M(O)-。在有机化学…

论文调研

一、论文部分 基于傅里叶文档恢复的鲁棒文档去锐化与识别https://www.semanticscholar.org/paper/Fourier-Document-Restoration-for-Robust-Document-Xue-Tian/64dcd0cac46b936eb413f36b462be3b5b298c75b 1. 由于这篇论文没有给代码,所以在connected papers上查找…

Spring Security 安全框架 (一) 基础操作

1.password 登录密码 在 springboot 项目中 , 引入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency><dependency><groupId>org.springfra…

因特网的组成,边缘之间的通讯方式,数据交换的方式

边缘之间的通讯方式有俩种&#xff1a; 1.客户服务器方式 2.对等方式&#xff08;pear-to-pear&#xff09; 什么是客户端服务器方式&#xff1f; 客户 (client) 和服务器 (server) 都是指通信中所涉及的两个应用进程。 客户-服务器方式所描述的是进程之间服务和被服务的关系…

QT菜单栏,工具栏,状态栏

1. 菜单栏 用代码来实现菜单栏&#xff1a; 头文件&#xff1a;mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H ​ #include <QMainWindow> ​ QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE ​ class MainWindow : public QMai…

如何用JavaScript完美地区分双击和单击事件

通过一个悬浮球交互功能的案例来阐述问题&#xff0c;以及解决办法。 实现效果 类似微信里的悬浮窗效果&#xff0c;苹果手机的悬浮球功能效果 1.可以点击拖动&#xff0c;然后吸附在窗口边缘2.点击悬浮球&#xff0c;可以跳转界面&#xff0c;或者更改悬浮球的形态准备 1.移…

C++ 语法基础课2 —— printf 语句与判断结构

文章目录1. printf 输出格式(#include<cstdio>)1.1 int、float、double、char 等类型的输出格式1.2 所有输出的变量均可包含在一个字符串中1.2.1 练习11.2.2 练习21.3 扩展功能2. if 语句2.1 基本 if-else 语句2.1.1 练习12.1.2 练习22.1.3 练习42.2 常用比较运算符2.3 i…

金融业数字化聚焦容器云,全闪存为什么是点睛之笔?

文|螳螂观察 作者|李永华 刻板、保守、小心翼翼…… 很多人对金融业尤其是银行在数字化创新方面的印象&#xff0c;都是如此。 这个印象到底对不对&#xff1f; 答案可能是&#xff0c;既对&#xff0c;又不对。 对的地方在于&#xff0c;出于合规等要求&#xff0c;一个…