條件機率(Conditional Probability)的概念,Bayes Formula,在日常生活中機率應該是最常使用的公式,由於多維的時候需要寫一長串公式,所以這邊自己嘗試定義推廣到抽象化的代數符號!!
令 $X,Y,Z$ 為連續隨機變數的集合,$f_X, f_Y,f_Z$ 為 joint pdf
1.Define:
$$\left<\frac{X}{Y} \right> := \frac{f_{X\cup Y}}{f_Y} $$
(p.s : 意思是給定 $Y$ 資訊下,測量$X$ 的機率密度 ,即 $X|Y$ 的分布)
-------------------------------------------------------------------
[Ex: 二維的例子]
$$X = \{x_1,x_2\}, Y=\{x_2\} \Longrightarrow \left<\frac{X}{Y} \right> = \frac{f(x_1,x_2)}{f(x_2)} $$
其中分子為 joint $(x_1,x_2)$ , 分母為 marginal $x_2$
-------------------------------------------------------------------
2.No Information : ($f_\emptyset = 1$)
$$ \left< \frac{X}{\emptyset} \right> := f_X$$
3.Integration Formula : (if $Y\subset X$)
$$ \left<\frac{Y}{Z} \right>= \int_{X\setminus Y}\left<\frac{X}{Z} \right> $$
--------------------------------------------------------------------
[Ex: 二維的例子]
$X = \{x_1,x_2\}, Y=\{x_1\},Z=\emptyset$
$$\Longrightarrow \left<\frac{Y}{Z} \right> = f(x_1) = \int_{x_2 \in \mathbb{R}}f(x_1,x_2) dx_2 = \int_{X\setminus Y}\left<\frac{X}{Z} \right> $$
其中左式為 marginal $x_1$ 右式為 joint $(x_1,x_2)$ 對 $x_2$ 的積分
--------------------------------------------------------------------
4.Equal To 1:
$$ \left< \frac{\emptyset}{Z} \right> = \int_{X\setminus \emptyset} \left<\frac{X}{Z} \right> = 1 $$
5.Bayes' Theorem :
$$ \left<\frac{Y}{X\cup Z} \right> \cdot \left<\frac{X}{Z}\right> = \left<\frac{X\cup Y}{Z}\right> = \left<\frac{X}{Y\cup Z} \right> \cdot \left<\frac{Y}{Z}\right> $$
--------------------------------------------------------------------
[Ex: 二維的例子]
$X = \{x_1\}, Y=\{x_2\},Z=\emptyset$
$$ f(x_2|x_1)\cdot f(x_1) = f(x_1,x_2) = f(x_1|x_2) \cdot f(x_2)$$
這就是 conditional $\times$ marginal $=$ joint !!
--------------------------------------------------------------------
(註: 貝氏統計(Bayesian statsitics)裡,$X$ 為母體參數向量,$Y$ 為樣本隨機向量,$Z = \emptyset$
當樣本給定$X$時!! 則 $\left<\frac{Y}{X\cup Z} \right>$ 稱為 likelihood ,$\left<\frac{X}{Z} \right>$ 稱為 prior ,$\left<\frac{X}{Y\cup Z}\right>$ 稱為 posterior)
6.$X,Y$ are independent :
$$ \left<\frac{X}{Y} \right>= \left< \frac{X}{\emptyset} \right> \text{ and } \left<\frac{Y}{X} \right>= \left< \frac{Y}{\emptyset} \right> $$
7.$X$ self-independent :
$$ \left<\frac{X}{Z} \right>= \prod_{x\in X}\left< \frac{\{x\}}{Z} \right>$$
-----------------------------------------------------------------
[Ex: Naive Bayes Classifier 的假設]
$X = \{x_1,x_2,x_3,....x_n\}$,$Z= \{z\}$
$$ f(x_1,x_2,....x_n|z) = \prod^{n}_{i=1} f(x_i|z) $$
------------------------------------------------------------------
8.$X$ joint pdf-decomposition :
(Given Nested Sequence $S_i$ s.t $\overset{=S_0}{\emptyset} \subset S_1\subset...\subset S_{n-1} \subset \overset{=S_n}{X} $)
$$ \left<\frac{X}{\emptyset} \right>= \prod^{n}_{i= 1}\left< \frac{S_{i}}{S_{i-1}} \right> = \prod^{n}_{i= 1}\left< \frac{S_{i}\setminus S_{i-1}}{S_{i-1}} \right> $$
[註 : 因為 $S_{i-1} \subset S_{i} \Longrightarrow S_{i}\cup S_{i-1} = (S_{i}\setminus S_{i-1}) \cup S_{i-1} $]
--------------------------------------------------------------------
[Ex: 四維單一展開]
$X = \{x_1,x_2,x_3,x_4\} , S_1=\{x_1\} ,S_2=\{x_1,x_2\} , S_3 = \{x_1,x_2,x_3\} $
$$ f(x_1,x_2,x_3,x_4) = f(x_1) \cdot f(x_2|x_1) \cdot f(x_3 | x_1,x_2) \cdot f(x_4 | x_1,x_2,x_3) $$
--------------------------------------------------------------------
令 $X,Y,Z$ 為連續隨機變數的集合,$f_X, f_Y,f_Z$ 為 joint pdf
1.Define:
$$\left<\frac{X}{Y} \right> := \frac{f_{X\cup Y}}{f_Y} $$
(p.s : 意思是給定 $Y$ 資訊下,測量$X$ 的機率密度 ,即 $X|Y$ 的分布)
-------------------------------------------------------------------
[Ex: 二維的例子]
$$X = \{x_1,x_2\}, Y=\{x_2\} \Longrightarrow \left<\frac{X}{Y} \right> = \frac{f(x_1,x_2)}{f(x_2)} $$
其中分子為 joint $(x_1,x_2)$ , 分母為 marginal $x_2$
-------------------------------------------------------------------
2.No Information : ($f_\emptyset = 1$)
$$ \left< \frac{X}{\emptyset} \right> := f_X$$
3.Integration Formula : (if $Y\subset X$)
$$ \left<\frac{Y}{Z} \right>= \int_{X\setminus Y}\left<\frac{X}{Z} \right> $$
--------------------------------------------------------------------
[Ex: 二維的例子]
$X = \{x_1,x_2\}, Y=\{x_1\},Z=\emptyset$
$$\Longrightarrow \left<\frac{Y}{Z} \right> = f(x_1) = \int_{x_2 \in \mathbb{R}}f(x_1,x_2) dx_2 = \int_{X\setminus Y}\left<\frac{X}{Z} \right> $$
其中左式為 marginal $x_1$ 右式為 joint $(x_1,x_2)$ 對 $x_2$ 的積分
--------------------------------------------------------------------
4.Equal To 1:
$$ \left< \frac{\emptyset}{Z} \right> = \int_{X\setminus \emptyset} \left<\frac{X}{Z} \right> = 1 $$
5.Bayes' Theorem :
$$ \left<\frac{Y}{X\cup Z} \right> \cdot \left<\frac{X}{Z}\right> = \left<\frac{X\cup Y}{Z}\right> = \left<\frac{X}{Y\cup Z} \right> \cdot \left<\frac{Y}{Z}\right> $$
--------------------------------------------------------------------
[Ex: 二維的例子]
$X = \{x_1\}, Y=\{x_2\},Z=\emptyset$
$$ f(x_2|x_1)\cdot f(x_1) = f(x_1,x_2) = f(x_1|x_2) \cdot f(x_2)$$
這就是 conditional $\times$ marginal $=$ joint !!
--------------------------------------------------------------------
(註: 貝氏統計(Bayesian statsitics)裡,$X$ 為母體參數向量,$Y$ 為樣本隨機向量,$Z = \emptyset$
當樣本給定$X$時!! 則 $\left<\frac{Y}{X\cup Z} \right>$ 稱為 likelihood ,$\left<\frac{X}{Z} \right>$ 稱為 prior ,$\left<\frac{X}{Y\cup Z}\right>$ 稱為 posterior)
6.$X,Y$ are independent :
$$ \left<\frac{X}{Y} \right>= \left< \frac{X}{\emptyset} \right> \text{ and } \left<\frac{Y}{X} \right>= \left< \frac{Y}{\emptyset} \right> $$
7.$X$ self-independent :
$$ \left<\frac{X}{Z} \right>= \prod_{x\in X}\left< \frac{\{x\}}{Z} \right>$$
-----------------------------------------------------------------
[Ex: Naive Bayes Classifier 的假設]
$X = \{x_1,x_2,x_3,....x_n\}$,$Z= \{z\}$
$$ f(x_1,x_2,....x_n|z) = \prod^{n}_{i=1} f(x_i|z) $$
------------------------------------------------------------------
8.$X$ joint pdf-decomposition :
(Given Nested Sequence $S_i$ s.t $\overset{=S_0}{\emptyset} \subset S_1\subset...\subset S_{n-1} \subset \overset{=S_n}{X} $)
$$ \left<\frac{X}{\emptyset} \right>= \prod^{n}_{i= 1}\left< \frac{S_{i}}{S_{i-1}} \right> = \prod^{n}_{i= 1}\left< \frac{S_{i}\setminus S_{i-1}}{S_{i-1}} \right> $$
[註 : 因為 $S_{i-1} \subset S_{i} \Longrightarrow S_{i}\cup S_{i-1} = (S_{i}\setminus S_{i-1}) \cup S_{i-1} $]
--------------------------------------------------------------------
[Ex: 四維單一展開]
$X = \{x_1,x_2,x_3,x_4\} , S_1=\{x_1\} ,S_2=\{x_1,x_2\} , S_3 = \{x_1,x_2,x_3\} $
$$ f(x_1,x_2,x_3,x_4) = f(x_1) \cdot f(x_2|x_1) \cdot f(x_3 | x_1,x_2) \cdot f(x_4 | x_1,x_2,x_3) $$
--------------------------------------------------------------------
[以上純為學術經驗交流知識分享,如有錯誤或建議可留言~~]
by Plus & Minus 2017.08
留言
張貼留言