🟰

# 条件付き期待値と分散の公式と証明

2024/07/13に公開

## 導出する公式

\begin{aligned} \mathbb{E}_{X}[X] & = \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right] \\ \mathbb{V}_{X}[X] & = \mathbb{E}_{Y}\left[V_{X \mid Y}[X]\right] + V_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right] \end{aligned}

## 条件付き期待値の公式を導出

\begin{aligned}\mathbb{E}_{X}[g(x)] & = \int g(x) f_{X}(x) d x \\ & = \iint g(x) f_{X, Y}(x, y) d y d x \\ & =\iint g(x) \frac{f_{X, Y}(x, y)}{f_{Y}(y)} f_{Y}(y) d y d x \\ & = \iint g(x) \frac{f_{X, Y}(x, y)}{f_{Y}(y)} f_{Y}(y) d x d y \\ & = \int\left\{\int g(x) \frac{f_{X, Y}(x, y)}{f_{Y}(y)} d x\right\} f_{Y}(y) d y \\ & = \int \mathbb{E}_{X|Y}[g(x)] f_{Y}(y) d y \\ & = \mathbb{E}_{Y}\left[\mathbb{E}_{X|Y}[g(x)]\right] \end{aligned}

f_{X|Y}(x) = \frac{f_{X, Y}(x, y)}{f_{Y}(y)}

\int g(x) \frac{f_{X, Y}(x, y)}{f_{Y}(y)} d x = \mathbb{E}_{X|Y}[g(x)]

## 条件付き分散の公式を導出

\begin{aligned} \mathbb{V}_{X}[X] & = \mathbb{E}\left[X^{2}\right]-\mathbb{E}[X]^{2} \\ & = \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}\left[X^{2}\right]\right] - \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right]^{2} \\ & = \mathbb{E}_{Y}\left[V_{X \mid Y}[X] + \mathbb{E}_{X \mid Y}[X]^{2}\right] - \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right]^{2} \\ & = \mathbb{E}_{Y}\left[V_{X \mid Y}[X]\right] + \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]^{2}\right] - \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right]^{2} \\ & = \mathbb{E}_{Y}\left[V_{X \mid Y}[X]\right] + V_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right] \end{aligned}

+ \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]^{2}\right] - \mathbb{E}_{Y}\left[\mathbb{E}_{X \mid Y}[X]\right]^{2}

+ \mathbb{E}_{Y}\left[ h(Y)^{2} \right] - \mathbb{E}_{Y}\left[ h(Y) \right]^{2}