跳至主要內容

Bayesian Network

Hirsun大约 7 分钟

Bayesian Network

Bayesian Networks

将多个因子联系起来。

1672813249056.png1672813272267.png

下图展示的就是一个参数化的贝叶斯网络。

1672818055475.png
1672818055475.png

后续将了解如何让从贝叶斯网络得到联合概率分布。

We can directly apply the chain rule for Bayesian networks here. This comes from the standard chain rule of probability, which states that

P(D,I,G,S,L)=P(D)P(ID)P(GD,I)P(SD,I,G)P(LD,I,G,S) P(D, I, G, S, L)=P(D) P(I \mid D) P(G \mid D, I) P(S \mid D, I, G) P(L \mid D, I, G, S)

贝叶斯网络

A Bayesian network is:

  • A directed acyclic graph「有向无环图」 (DAG)G whose nodes represent the random variables X1,....Xn
  • For each node Xi, a CPD P(XiParG(Xi))P\left(X_{i} \mid {P a r}_{G}\left(X_{i}\right)\right)
  • The BN represents a joint distribution

Chain Rule

简单的说,就是把各个 CPD 乘起来。

1672818570064.png

这种情况下,我们得到一个scope = 5 的因子。

建立贝叶斯网络

  1. 选择随机变量
  2. 选择顺序(最好是从根到子)
  3. 当有变量剩下的时候
    1. Add node 𝑋𝑖 to the BN
    2. Set parents of 𝑋𝑖 to the minimal subset such that 𝑋𝑖 is conditionally independent from non-parent nodes preceding i, given its parents.
    3. Define 𝑃 ( 𝑋𝑖|𝑝𝑎𝑟𝑒𝑛𝑡(𝑋𝑖) ) CPT

CPT是什么

全称 Conditional Probabilities Table

1657559527848.png1657559578197.png

Noisy-or

基于 Y 的 Parent 预测 P(Y = 1 | Parent)

1657559527848.png

P(Y=0xxk)=1OR(x1xk)P\left(Y=0 \mid x_{\ldots} \ldots x_{k}\right)=1-O R\left(x_{1} \ldots x_{k}\right)OR(x1xk)={1 if any xi=10 otherwise O R\left(x_{1} \cdots x_{k}\right)=\left\{\begin{array}{ll} 1 & \text { if any } x_{i}=1 \\ 0 & \text { otherwise } \end{array}\right. ,可得

P(Y=0x1xk)=i=1k(1pi)xi P\left(Y=0 \mid x_{1} \cdots x_{k}\right)=\prod_{i=1}^{k}\left(1-p_{i}\right)^{x_{i}}

P(Y=1x1xk)=1i=1k(1pi)xi P\left(Y=1 \mid x_{1} \cdots x_{k}\right)=1-\prod_{i=1}^{k}\left(1-p_{i}\right)^{x_{i}}

其中 xi = 0 或者 xi = 1

例题

Let P(Y=1X1=0,,Xi=1,Xj=1,,Xk=0)=13P\left(Y=1 \mid X_{1}=0, \ldots, X_{i}=1, X_{j}=1, \ldots, X_{k}=0\right)=\frac{1}{3} and pi=15p_{i}=\frac{1}{5},what is p?

1(115)(1pj)=13 1-\left(1-\frac{1}{5}\right)\left(1-p_{j}\right)=\frac{1}{3}

Active Trails

When can X influence y?

1672833132167.png

When can X influence Y Given evidence about Z?

1672834828989.png1672835030957.png

A trail X1 - ... - Xn is active given Z if:

  • If or any v-structure Xi-1􏰀 → 􏰀 Xi􏰁 ← Xi+1 we have that Xi or one of its descendants ∈Z
  • no other Xi is in Z

条件独立

When is X conditionally independent of Y given E(evidence)?

  • P(X,YE)=P(XE)P(YE)P(X, Y \mid E)=P(X \mid E) P(Y \mid E)
  • P(YX,E)=P(YE)P(Y \mid X , E)= P(Y \mid E)
  • P(XY,E)=P(XE)P(X \mid Y , E)= P(X \mid E)

提示

Theorem: P(X,YE)=P(XE)P(YE)P(X, Y \mid E)=P(X \mid E) P(Y \mid E) if and only if every UNDIRECTED path from a node in X to a node in Y is "d-separated" ("blocked") by E.