离散型随机变量的条件分布
联合分布表 $(X,Y)$
| $X \setminus Y$ | $0$ | $1$ | 边缘和 $P_{i\cdot}$ |
|---|---|---|---|
| $1$ | $0.2$ | $0.3$ | $0.5$ |
| $2$ | $0.1$ | $0.4$ | $0.5$ |
| 边缘和 $P_{\cdot j}$ | $0.3$ | $0.7$ | $1$ |
条件概率计算示例
已知 $X=1$ 时,$Y$ 的条件分布
- $P\{Y=0 \mid X=1\} = \dfrac{P\{X=1,Y=0\}}{P\{X=1\}} = \dfrac{0.2}{0.5} = 0.4$
- $P\{Y=1 \mid X=1\} = \dfrac{P\{X=1,Y=1\}}{P\{X=1\}} = \dfrac{0.3}{0.5} = 0.6$
对应的条件分布表:
| $Y$ | $0$ | $1$ |
|---|---|---|
| $P\{Y \mid X=1\}$ | $0.4$ | $0.6$ |
已知 $Y=0$ 时,$X$ 的条件分布
- $P\{X=1 \mid Y=0\} = \dfrac{P\{X=1,Y=0\}}{P\{Y=0\}} = \dfrac{0.2}{0.3} = \dfrac{2}{3}$
- $P\{X=2 \mid Y=0\} = \dfrac{P\{X=2,Y=0\}}{P\{Y=0\}} = \dfrac{0.1}{0.3} = \dfrac{1}{3}$
条件分布公式
- $P\{X=x_i \mid Y=y_j\} = \dfrac{P\{X=x_i,Y=y_j\}}{P\{Y=y_j\}} = \dfrac{p_{ij}}{P_{\cdot j}}$
- $P\{Y=y_j \mid X=x_i\} = \dfrac{P\{X=x_i,Y=y_j\}}{P\{X=x_i\}} = \dfrac{p_{ij}}{P_{i\cdot}}$
例题
连续型随机变量的条件密度
条件密度的定义
- 给定 $y$,若 $f_Y(y) > 0$,则 $X$ 在 $Y=y$ 条件下的条件密度:
$$f_{X|Y}(x \mid y) = \frac{f(x,y)}{f_Y(y)} $$
- 给定 $x$,若 $f_X(x) > 0$,则 $Y$ 在 $X=x$ 条件下的条件密度:
$$f_{Y|X}(y \mid x) = \frac{f(x,y)}{f_X(x)} $$
条件密度的性质
-
非负性与归一性:
$$f_{X|Y}(x \mid y) \ge 0, \quad \int_{-\infty}^{+\infty} f_{X|Y}(x \mid y) \, dx = 1 $$
-
分布间的推导关系:
$$f(x,y) \rightleftharpoons f_X(x), f_Y(y) \rightarrow f_{X|Y}(x \mid y), f_{Y|X}(y \mid x) $$
其中,联合密度 $f(x,y)$ 可由边缘密度和条件密度还原:
$$f(x,y) = f_X(x) \cdot f_{Y|X}(y \mid x) = f_Y(y) \cdot f_{X|Y}(x \mid y) $$
-
独立性条件:
若 $X$ 与 $Y$ 相互独立,则:$$f(x,y) = f_X(x) \cdot f_Y(y) $$
此时条件密度退化为边缘密度:
$$f_{X|Y}(x \mid y) = f_X(x), \quad f_{Y|X}(y \mid x) = f_Y(y) $$
例题,二维均匀分布(圆域)的条件密度
题目设定
设随机变量 $(X,Y)$ 在圆域 $G=\{(x,y)\mid x^2+y^2\le R^2\}$ 上服从均匀分布,求条件概率密度。
联合概率密度
$$f(x,y)= \begin{cases} \dfrac{1}{\pi R^2}, & x^2+y^2\le R^2 \\[6pt] 0, & \text{其他} \end{cases} $$
边缘概率密度
-
$X$ 的边缘密度:
$$f_X(x)= \begin{cases} \dfrac{2\sqrt{R^2-x^2}}{\pi R^2}, & |x|\le R \\[6pt] 0, & \text{其他} \end{cases} $$
-
$Y$ 的边缘密度:
$$f_Y(y)= \begin{cases} \dfrac{2\sqrt{R^2-y^2}}{\pi R^2}, & |y|\le R \\[6pt] 0, & \text{其他} \end{cases} $$
条件概率密度
(1) $Y=y$ 条件下 $X$ 的条件密度 $f_{X|Y}(x|y)$
当 $|y|<R$(此时 $f_Y(y)>0$)时:
$$f_{X|Y}(x|y)= \begin{cases} \dfrac{1}{2\sqrt{R^2-y^2}}, & -\sqrt{R^2-y^2}\le x\le\sqrt{R^2-y^2} \\[6pt] 0, & \text{其他} \end{cases} $$
推导:
$$f_{X|Y}(x|y)=\frac{f(x,y)}{f_Y(y)}=\frac{\dfrac{1}{\pi R^2}}{\dfrac{2\sqrt{R^2-y^2}}{\pi R^2}}=\frac{1}{2\sqrt{R^2-y^2}} $$
(2) $X=x$ 条件下 $Y$ 的条件密度 $f_{Y|X}(y|x)$
当 $|x|<R$(此时 $f_X(x)>0$)时:
$$f_{Y|X}(y|x)= \begin{cases} \dfrac{1}{2\sqrt{R^2-x^2}}, & -\sqrt{R^2-x^2}\le y\le\sqrt{R^2-x^2} \\[6pt] 0, & \text{其他} \end{cases} $$
推导:
$$f_{Y|X}(y|x)=\frac{f(x,y)}{f_X(x)}=\frac{\dfrac{1}{\pi R^2}}{\dfrac{2\sqrt{R^2-x^2}}{\pi R^2}}=\frac{1}{2\sqrt{R^2-x^2}} $$
例题二
设随机变量 $X \sim U(0,1)$(在 $(0,1)$ 上均匀分布),当 $X=x$($0<x<1$)时,$Y$ 在区间 $(x,1)$ 上均匀分布。求 $Y$ 的边缘密度 $f_Y(y)$。
步骤1:写出 $X$ 的边缘密度
$$f_X(x) = \begin{cases} 1, & 0 < x < 1 \\[6pt] 0, & \text{其他} \end{cases} $$
步骤2:写出条件密度 $f_{Y|X}(y|x)$
当 $0 < x < 1$ 时,$Y \sim U(x,1)$,故:
$$f_{Y|X}(y|x) = \begin{cases} \dfrac{1}{1-x}, & x < y < 1 \\[6pt] 0, & \text{其他} \end{cases} $$
步骤3:求联合密度 $f(x,y)$
根据条件密度公式 $f(x,y) = f_X(x) \cdot f_{Y|X}(y|x)$,可得:
$$f(x,y) = \begin{cases} \dfrac{1}{1-x}, & 0 < x < 1,\ x < y < 1 \\[6pt] 0, & \text{其他} \end{cases} $$
步骤4:求 $Y$ 的边缘密度 $f_Y(y)$
当 $0 < y < 1$ 时:
$$f_Y(y) = \int_{-\infty}^{+\infty} f(x,y) dx = \int_{0}^{y} \frac{1}{1-x} dx $$
计算积分:
$$\int_{0}^{y} \frac{1}{1-x} dx = -\ln(1-x)\bigg|_{0}^{y} = -\ln(1-y) + \ln(1-0) = -\ln(1-y) $$
因此:
$$f_Y(y) = \begin{cases} -\ln(1-y), & 0 < y < 1 \\[6pt] 0, & \text{其他} \end{cases} $$

说些什么吧!