Law of total expectation證明
Law of total expectation的公式為:
E
(
X
)
=
E
(
E
(
X
∣
Y
)
)
\operatorname{E} (X) = \operatorname{E} \left( \operatorname{E} (X \mid Y) \right)
E(X)=E(E(X∣Y))
參考Law of total expectation - Proof in the finite and countable cases,證明如下:
E ( E ( X ∣ Y ) ) = E [ ∑ x x ⋅ P ( X = x ∣ Y ) ] 在外層給定一個y(y固定)的情況下,展開內層期望值 = ∑ y [ ∑ x x ⋅ P ( X = x ∣ Y = y ) ] ⋅ P ( Y = y ) 展開外層期望值,並注意到內層期望值是y的函數 = ∑ y ∑ x x ⋅ P ( X = x , Y = y ) . 聯合分布 \begin{aligned} \operatorname{E} \left( \operatorname{E} (X \mid Y) \right) &= \operatorname{E} \Bigg[ \sum_x x \cdot \operatorname{P}(X=x \mid Y) \Bigg] && \text{在外層給定一個y(y固定)的情況下,展開內層期望值} \\[6pt] &=\sum_y \Bigg[ \sum_x x \cdot \operatorname{P}(X=x \mid Y=y) \Bigg] \cdot \operatorname{P}(Y=y) && \text{展開外層期望值,並注意到內層期望值是y的函數} \\[6pt] &=\sum_y \sum_x x \cdot \operatorname{P}(X=x, Y=y). && \text{聯合分布} \end{aligned} E(E(X∣Y))=E[x∑x⋅P(X=x∣Y)]=y∑[x∑x⋅P(X=x∣Y=y)]⋅P(Y=y)=y∑x∑x⋅P(X=x,Y=y).在外層給定一個y(y固定)的情況下,展開內層期望值展開外層期望值,並注意到內層期望值是y的函數聯合分布
如果上面的級數是有限的,我們便可以交換求和符號的順序:
E ( E ( X ∣ Y ) ) = ∑ x ∑ y x ⋅ P ( X = x , Y = y ) = ∑ x x ∑ y P ( X = x , Y = y ) x 對內層的 ∑ 來說是常數 = ∑ x x ⋅ P ( X = x ) = E ( X ) . \begin{aligned} \operatorname{E} \left( \operatorname{E} (X \mid Y) \right) &= \sum_x \sum_y x \cdot \operatorname{P}(X=x, Y=y)\\&=\sum_x x\sum_y \operatorname{P}(X=x, Y=y) && x\text{對內層的}\sum\text{來說是常數}\\[6pt] &=\sum_x x \cdot \operatorname{P}(X=x)\\[6pt] &=\operatorname{E}(X). \end{aligned} E(E(X∣Y))=x∑y∑x⋅P(X=x,Y=y)=x∑xy∑P(X=x,Y=y)=x∑x⋅P(X=x)=E(X).x對內層的∑來說是常數