W7.L6-7. Bayesian Network - Inference Question on Bayesian Networks
| Inference Question: Conditional Probability
$ P(\textup{A} \mid \textup{B}=\textup{True}, \textup{MC}=\textup{True} ) $
B = True 그리고 MarryCalls = True 인 경우, Alarm 이 울렸을 확률은 ?
이러한 Evidence 가 있는 상황에서 가장 Likely 한 Label 은 무엇인가? A 가 True 일까 False 일까?
이런 것들을 하는데 아주 유용한 것이 Conditional Probability !
$ X_V $ : Evidence
$ X_H $ : Hidden
- $ X_H = \left\{ Y, Z \right\} $
* $ Y $ : interested hidden variables
* $ Z $ : uninterested hidden variables
어떠한 Evidence 가 주어졌을 때,
관심있는 Event 가 True 일까 False 일까 어떤 확률분포를 가지는지
알아내는 Conditional Probability
$$
\begin{align*}
P(Y \mid x_{V}) &= \sum_{Z} P(Y, Z=z \mid x_{V}) \\
&= \sum_{Z} \frac{P(Y, Z, x_{V})}{P(x_{V})} \\
&= \sum_{Z} \frac{P(Y, Z, x_{V})}{\sum_{Y, Z} P(Y=y, Z=z, x_{V})} \\
\end{align*}
$$
(문제를 Full Joint 쪽으로 Derive 하는 형식)
| Inference Question: Most Probable Assignment
$ argmax_{a} \ P(\textup{A} \mid \textup{B}=\textup{True}, \textup{MC}=\textup{True} ) $
Given a set of evidence, what is the most probable assignment, or explanation, given the evidence?
Prediction:
B, E → A
$ P (A \mid B, E ) $
B, E 에 관측하고 A 의 Most Probable Assignment 찾을 수 있다.
B, E 가 Given 인 상황에서 A 의 확률분포를 알고 싶다.
B 와 E 가 일어나면 A 가 일어날 확률은 어떻게 될까요?
A = True, A = False 2 가지의 확률이 도출
Diagnosis:
A → B, E
$ P(B, E \mid A ) $
A가 Given 인 상황에서 B 와 E 의 Joint assignment 는 어떻게 될까요?
(B = T, E = T), (B = T, E = F), (B = F, E = T), (B = F, E = F) 총 4 가지 조합의 확률이 도출
A 라는 것이 관측되었을 경우, 가장 Likely 한 B, E 에 대한 Label 을 찾아봐라
| Marginalization and Elimination
$$
\begin{align*}
P(a=\textup{True},\ b=\textup{True}, \ c=\textup{True}) &= \sum_{JC}\sum_{E}P(a, b, E, JC, mc) \\
&= \sum_{JC} \sum_{E} P(JC \mid a) P(mc \mid a) P(a \mid b, E) P(E) P(b) \\
\end{align*}
$$
관측된 변수 3개의 Partial Joint Probability 계산
Hidden 2 개의 변수에 대해 Marginalization 으로 Full joint 만들고,
그래프 상 Conditional independent 관계를 보고 Factorization 한 결과
Is there any better method?
Reduced the computation complexity
$$
\begin{align*}
P(a, b, c) &= \sum_{JC}\sum_{E}P(a, b, E, JC, mc) \\
&= P(b) P(mc \mid a) \sum_{JC} P(JC \mid a) \sum_{E} P(a \mid b, E) P(E) \\
\end{align*}
$$
| Variable Elimination
Preliminary
$$ P (e \mid jc, mc) = \frac{1}{P(jc, mc)} P(e, jc, mc) = \alpha P(e, jc, mc) $$
$$
\begin{align*}
P (e \mid jc, mc) = \alpha P(e, jc, mc) &= \alpha \sum_{B} \sum_{A} P(e, jc, mc, B, A) \\
&= \alpha \sum_{B} \sum_{A} P(b) \cdot P(e) \cdot P(a \mid b, e) \cdot P(jc \mid a) \cdot P(mc \mid a) \\
&= \alpha P(e) \sum_{B} P(b) \sum_{A} P(a \mid b, e) \cdot P(jc \mid a) \cdot P(mc \mid a) \\
&= \alpha f_E(e) \sum_{B} f_{B} (b) \sum_{A} f_{A}(a, b, e) \cdot f_{J}(a) \cdot f_{M}(a) \\
&= \alpha f_E(e) \sum_{B} f_{B} (b) \sum_{A} f_{A} (a, b, e) \cdot f_{JM} (a) \\
\end{align*}
$$
$$
\begin{align*}
\alpha f_E(e) \sum_{B} f_{B} (b) \sum_{A} f_{A} (a, b, e) \cdot f_{JM} (a) &= \alpha f_E(e) \sum_{B} f_{B} (b) \sum_{A} f_{AJM} (a, b, e) \\
&= \alpha f_E(e) \sum_{B} f_{B} (b) f_{\bar{A}JM} (b, e) \\
&= \alpha f_E(e) \sum_{B} f_{B\bar{A}JM} (b, e) \\
&= \alpha f_E(e) f_{\bar{B}\bar{A}JM} (e) \\
&= \alpha f_{E\bar{B}\bar{A}JM} (e) \\
\end{align*}
$$
Reference
문일철 교수님 강의
https://www.youtube.com/watch?v=mnUcZbT5E28&list=PLbhbGI_ppZISMV4tAWHlytBqNq1-lb8bz&index=44
https://www.youtube.com/watch?v=mnUcZbT5E28&list=PLbhbGI_ppZISMV4tAWHlytBqNq1-lb8bz&index=45