机器学习系列:概率图模型

1. Introduction

概率图模型使用图的方式表示概率分布。为了在图中添加各种概率,首先总结一下随机变量分布的一些规则:
S u m   R u l e : p ( x 1 ) = ∫ p ( x 1 , x 2 ) d x 2 P r o d u c t   R u l e : p ( x 1 , x 2 ) = p ( x 1 ∣ x 2 ) p ( x 2 ) C h a i n   R u l e : p ( x 1 , x 2 , ⋯   , x p ) = ∏ i = 1 p p ( x i ∣ x i + 1 , x i + 2 ⋯ x p ) B a y e s i a n   R u l e : p ( x 1 ∣ x 2 ) = p ( x 2 ∣ x 1 ) p ( x 1 ) p ( x 2 ) \begin{aligned} &Sum\ Rule:p(x_1)=\int p(x_1,x_2)dx_2\\ &Product\ Rule:p(x_1,x_2)=p(x_1|x_2)p(x_2)\\ &Chain\ Rule:p(x_1,x_2,\cdots,x_p)=\prod\limits_{i=1}^pp(x_i|x_{i+1,x_{i+2} \cdots}x_p)\\ &Bayesian\ Rule:p(x_1|x_2)=\frac{p(x_2|x_1)p(x_1)}{p(x_2)} \end{aligned} Sum Rule:p(x1)=p(x1,x2)dx2Product Rule:p(x1,x2)=p(x1x2)p(x2)Chain Rule:p(x1,x2,,xp)=i=1pp(xixi+1,xi+2xp)Bayesian Rule:p(x1x2)=p(x2)p(x2x1)p(x1)
可以看到,在链式法则中,如果数据维度特别高,那么的采样和计算非常困难,我们需要在一定程度上作出简化,在朴素贝叶斯中,作出了条件独立性假设。在 Markov 假设中,给定数据的维度是以时间顺序出现的,给定当前时间的维度,那么下一个维度与之前的维度独立。在 HMM 中,采用了齐次 Markov 假设。在 Markov 假设之上,更一般的,加入条件独立性假设,对维度划分集合 A , B , C A,B,C A,B,C,使得 X A ⊥ X B ∣ X C X_A\perp X_B|X_C XAXBXC
概率图模型采用图的特点表示上述的条件独立性假设,节点表示随机变量,边表示条件概率。概率图模型可以分为三大理论部分:

  1. 表示
    • 有向图(离散):贝叶斯网络
    • 高斯图(连续):高斯贝叶斯和高斯马尔科夫网络
    • 无向图(离散):马尔科夫网络
  2. 推断
    • 精确推断
    • 近似推断
      • 确定近似(如变分推断,利用数学推导)
      • 随机近似(MCMC,利用采样近似)
  3. 学习
    • 参数学习
      • 完备数据
      • 有隐变量:E-M算法
    • 结构学习

2. 有向图-贝叶斯网络

已知联合分布中,各个随机变量之间的依赖关系,那么可以通过拓扑排序(根据依赖关系)可以获得一个有向图。而如果已知一个图,也可以直接得到联合概率分布的因子分解: p ( x 1 , x 2 , ⋯   , x p ) = ∏ i = 1 p p ( x i ∣ x p a r e n t ( i ) ) p(x_1,x_2,\cdots,x_p)=\prod\limits_{i=1}^pp(x_i|x_{parent(i)}) p(x1,x2,,xp)=i=1pp(xixparent(i)) 那么实际的图中条件独立性是如何体现的呢?在局部任何三个节点,可以有三种结构:

  1. p ( A , B , C ) = p ( A ) p ( B ∣ A ) p ( C ∣ B ) = p ( A ) p ( B ∣ A ) p ( C ∣ B , A ) ⟹ p ( C ∣ B ) = p ( C ∣ B , A ) ⇔ p ( C ∣ B ) p ( A ∣ B ) = p ( C ∣ A , B ) p ( A ∣ B ) = p ( C , A ∣ B ) ⟹ C ⊥ A ∣ B p(A,B,C)=p(A)p(B|A)p(C|B)=p(A)p(B|A)p(C|B,A) \\ \Longrightarrow p(C|B)=p(C|B,A)\\ \Leftrightarrow p(C|B)p(A|B)=p(C|A,B)p(A|B)=p(C,A|B)\Longrightarrow C\perp A|B p(A,B,C)=p(A)p(BA)p(CB)=p(A)p(BA)p(CB,A)p(CB)=p(CB,A)p(CB)p(AB)=p(CA,B)p(AB)=p(C,AB)CAB
    给定B,A和C独立

在这里插入图片描述

  1. p ( A , B , C ) = p ( A ∣ B ) p ( B ) p ( C ∣ B ) = p ( B ) p ( A ∣ B ) p ( C ∣ A , B ) ⟹ p ( C ∣ B ) = p ( C ∣ B , A ) ⇔ p ( C ∣ B ) p ( A ∣ B ) = p ( C ∣ A , B ) p ( A ∣ B ) = p ( C , A ∣ B )   ⟹ C ⊥ A ∣ B p(A,B,C)=p(A|B)p(B)p(C|B)=p(B)p(A|B)p(C|A,B)\\ \Longrightarrow p(C|B)=p(C|B,A)\\ \Leftrightarrow p(C|B)p(A|B)=p(C|A,B)p(A|B)=p(C,A|B)\ \Longrightarrow C\perp A|B p(A,B,C)=p(AB)p(B)p(CB)=p(B)p(AB)p(CA,B)p(CB)=p(CB,A)p(CB)p(AB)=p(CA,B)p(AB)=p(C,AB) CAB
    给定B的情况下A,C独立
    在这里插入图片描述
  2. p ( A , B , C ) = p ( A ) p ( C ) p ( B ∣ C , A ) = p ( A ) p ( C ∣ A ) p ( B ∣ C , A ) ⟹ p ( C ) = p ( C ∣ A ) ⇔ C ⊥ A   p(A,B,C)=p(A)p(C)p(B|C,A)=p(A)p(C|A)p(B|C,A)\\ \Longrightarrow p(C)=p(C|A)\\ \Leftrightarrow C\perp A\ p(A,B,C)=p(A)p(C)p(BC,A)=p(A)p(CA)p(BC,A)p(C)=p(CA)CA 
    注意,这个是不给定B的时候AC独立,给定B不独立
    在这里插入图片描述

3.无向图-马尔科夫网络(马尔科夫随机场)

无向图没有了类似有向图的局部不同结构,在马尔可夫网络中,也存在 D 划分的概念。直接将条件独立的集合 x A ⊥ x B ∣ x C x_A\perp x_B|x_C xAxBxC 划分为三个集合。这个也叫全局 Markov。对局部的节点, x ⊥ ( X − N e i g h b o u r ( x ) ) ∣ N e i g h b o u r ( x ) x\perp (X-Neighbour(\mathcal{x}))|Neighbour(x) x(XNeighbour(x))Neighbour(x)。这也叫局部 Markov。对于成对的节点: x i ⊥ x j ∣ x − i − j x_i\perp x_j|x_{-i-j} xixjxij,其中 i , j i,j i,j 不能相邻。这也叫成对 Markov。事实上上面三个点局部全局成对是相互等价的。
有了这个条件独立性的划分,还需要因子分解来实际计算。引入团的概念:

团,最大团:图中节点的集合,集合中的节点之间相互都是连接的叫做团,如果不能再添加节点,那么叫最大团

利用这个定义进行的 x x x 所有维度的联合概率分布的因子分解为,假设有 K K K 个团, Z Z Z 就是对所有可能取值求和:
p ( x ) = 1 Z ∏ i = 1 K ϕ ( x c i )   Z = ∑ x ∈ X ∏ i = 1 K ϕ ( x c i ) \begin{aligned}p(x)=\frac{1}{Z}\prod\limits_{i=1}^{K}\phi(x_{ci})\ Z=\sum\limits_{x\in\mathcal{X}}\prod\limits_{i=1}^{K}\phi(x_{ci}) \end{aligned} p(x)=Z1i=1Kϕ(xci) Z=xXi=1Kϕ(xci)
其中 ϕ ( x c i ) \phi(x_{ci}) ϕ(xci) 叫做势函数,它必须是一个正值,可以记为: ϕ ( x c i ) = exp ⁡ ( − E ( x c i ) ) \phi(x_{ci})=\exp(-E(x_{ci})) ϕ(xci)=exp(E(xci)) 这个分布叫做 Gibbs 分布(玻尔兹曼分布)。于是也可以记为: p ( x ) = 1 Z exp ⁡ ( − ∑ i = 1 K E ( x c i ) ) p(x)=\frac{1}{Z}\exp(-\sum\limits_{i=1}^KE(x_{ci})) p(x)=Z1exp(i=1KE(xci))。这个分解和条件独立性等价(Hammesley-Clifford 定理),这个分布的形式也和指数族分布形式上相同,于是满足最大熵原理。

4 两种图的转换-道德图

我们常常想将有向图转为无向图,从而应用更一般的表达式。

  1. 链式
    在这里插入图片描述
    直接去掉箭头, p ( a , b , c ) = p ( a ) p ( b ∣ a ) p ( c ∣ b ) = ϕ ( a , b ) ϕ ( b , c ) p(a,b,c)=p(a)p(b|a)p(c|b)=\phi(a,b)\phi(b,c) p(a,b,c)=p(a)p(ba)p(cb)=ϕ(a,b)ϕ(b,c)
    在这里插入图片描述

  2. v型
    在这里插入图片描述
    由于 p ( a , b , c ) = p ( b ) p ( a ∣ b ) p ( c ∣ b ) = ϕ ( a , b ) ϕ ( b , c ) p(a,b,c)=p(b)p(a|b)p(c|b)=\phi(a,b)\phi(b,c) p(a,b,c)=p(b)p(ab)p(cb)=ϕ(a,b)ϕ(b,c),直接去掉箭头:
    在这里插入图片描述

  3. 倒v型
    在这里插入图片描述
    由于 p ( a , b , c ) = p ( a ) p ( c ) p ( b ∣ a , c ) = ϕ ( a , b , c ) p(a,b,c)=p(a)p(c)p(b|a,c)=\phi(a,b,c) p(a,b,c)=p(a)p(c)p(ba,c)=ϕ(a,b,c),于是在 a , c a,c a,c 之间添加线:
    在这里插入图片描述

5 因子图

对于一个有向图,可以通过引入环的方式,可以将其转换为无向图(Tree-like graph),这个图就叫做道德图。但是我们上面的 BP 算法只对无环图有效,通过因子图可以变为无环图。
考虑一个无向图:
在这里插入图片描述
其中 f = f ( a , b , c ) f=f(a,b,c) f=f(a,b,c)。因子图不是唯一的,这是由于因式分解本身就对应一个特殊的因子图,将因式分解: p ( x ) = ∏ s f s ( x s ) p(x)=\prod\limits_{s}f_s(x_s) p(x)=sfs(xs) 可以进一步分解得到因子图。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Statistical learning refers to a set of tools for modeling and understanding complex datasets. It is a recently developed area in statistics and blends with parallel developments in computer science and, in particular, machine learning. The field encompasses many methods such as the lasso and sparse regression, classification and regression trees, and boosting and support vector machines. With the explosion of “Big Data” problems, statistical learning has be- come a very hot field in many scientific areas as well as marketing, finance, and other business disciplines. People with statistical learning skills are in high demand. One of the first books in this area—The Elements of Statistical Learning (ESL) (Hastie, Tibshirani, and Friedman)—was published in 2001, with a second edition in 2009. ESL has become a popular text not only in statis- tics but also in related fields. One of the reasons for ESL’s popularity is its relatively accessible style. But ESL is intended for individuals with ad- vanced training in the mathematical sciences. An Introduction to Statistical Learning (ISL) arose from the perceived need for a broader and less tech- nical treatment of these topics. In this new book, we cover many of the same topics as ESL, but we concentrate more on the applications of the methods and less on the mathematical details. We have created labs illus- trating how to implement each of the statistical learning methods using the popular statistical software package R . These labs provide the reader with valuable hands-on experience.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值