易错点排雷 / 核心考点梳理
基于真实错题与笔记提取
生成函数是一种强大的工具,用于处理离散随机变量的概率分布。通过生成函数,我们可以方便地计算期望、方差等统计量,并且可以处理多个独立随机变量的和。
定义: $$\begin{aligned}&= G_X(t) \ &= \sum_{k=0}^{\infty} P(X = k)t^k\end{aligned}$$
关键应用:
线性变化:$G_{aX+b}(t) = t^b G_X(t^a)$
期望:直接看公示表
潜在难点:理论上题目可以给一个分布或者一个描述,然后你要机智地算出对应的每一个概率,然后根据定义写出自己的 $G_X(t)$。
例如:几何分布: $$\begin{aligned}&= G_X(t) \ &= \frac{pt}{1 - (1 - p)t}\end{aligned}$$
但本质还是概率是系数,指数是值,剩下的都是老套路很 ez~
概率密度函数(PDF) $ f(x) $,满足
$$\begin{aligned}&= \int_{-\infty}^{\infty} f(x)\,dx \
&= 1\end{aligned}$$
累积分布函数(CDF) $ F(x) = \int_{-\infty}^{x} f(t)\,dt $【从 0 到 1】
期望:
$$\begin{aligned}&= E(X) \
&= \int_{-\infty}^{\infty} x\,f(x)\,dx\end{aligned}$$
二阶矩:
$$\begin{aligned}&= E(X^2) \
&= \int_{-\infty}^{\infty} x^2\,f(x)\,dx\end{aligned}$$
方差:
$$\begin{aligned}&= \text{Var}(X) \
&= E(X^2) - [E(X)]^2\end{aligned}$$
变形 e.g.:
$$\begin{aligned}&= \text{Var}(\sqrt{X}) \
&= E(X) - [E(\sqrt{X})]^2 \
&= \int_{-\infty}^{\infty} x f(x)\,dx - \left( \int_{-\infty}^{\infty} \sqrt{x}\,f(x)\,dx \right)^2\end{aligned}$$
虽然从来没有考过,但是书上出现过,就是注意 $ Y $ 和 $ X $ 转化时候,绕 $ F(Y) $ 和 $ F(X) $ 时候,可能要 1 减。
例如:$ F(X) = X^2 $,换元 $ Y = \dfrac{1}{X} $,则
$$\begin{aligned}&= G(Y) \
&= 1 - \frac{1}{Y^2}\end{aligned}$$
因为当比如 $ X < 2 $ 时候,其实 $ Y > 1/2 $,所以要 1 减一下。
| 类型 | 情况 | 公式 |
|---|---|---|
| One sample | $\frac{\bar{x}-\mu}{s/\sqrt{n}} \sim t_{n-1}$ | |
| Two sample | $n \leq 30$ | $\frac{(\bar{x}-\bar{y})-(\mu_x-\mu_y)}{S_p\sqrt{\frac{1}{n_x}+\frac{1}{n_y}}} \sim t_{n_x+n_y-2}$ |
| $n \geq 30$ | $\frac{(\bar{x}-\bar{y})-(\mu_x-\mu_y)}{\sqrt{\frac{s_x^2}{n_x}+\frac{s_y^2}{n_y}}} \sim Z \sim N(0,1)$ | |
| Before & After | paired sample T | $\frac{d-k}{s_d/\sqrt{n}} \sim t_{n-1}$ where $H_0: \mu_e = k$ |
| 类型 | 情况 | 公式 |
|---|---|---|
| One sample | $\bar{x} \pm (t_{n-1,\alpha}) \cdot \frac{s}{\sqrt{n}}$ | |
| Two sample | $n \leq 30$ | $(\bar{x} - \bar{y}) \pm (t_{\alpha,n_x+n_y-2}) \cdot S_p\sqrt{\frac{1}{n_x}+\frac{1}{n_y}}$ |
| $n \geq 30$ | $(\bar{x} - \bar{y}) \pm (z_\alpha) \cdot \sqrt{\frac{s_x^2}{n_x}+\frac{s_y^2}{n_y}}$ | |
| Before & After | $d \pm (t_{\alpha,n-1}) \cdot \frac{s_d}{\sqrt{n}}$ |
$$\begin{aligned}&= \chi^2 \ &= \sum \frac{(O - E)^2}{E} \quad \text{for all}\end{aligned}$$
| 分布类型 | 自由度(df)公式 |
|---|---|
| Binomial | $ \nu = n - 1 $ if $ p $ not estimated $ \nu = n - 2 $ if $ p $ estimated |
| Poisson | $ \nu = n - 1 $ if $ \lambda $ not estimated $ \nu = n - 2 $ if $ \lambda $ estimated |
| Normal | $ \nu = n - 1 $ if $ \mu $ and $ \sigma^2 $ not estimated $ \nu = n - 2 $ if $ \mu $ or $ \sigma^2 $ estimated $ \nu = n - 3 $ if $ \mu $ and $ \sigma^2 $ estimated |
基本根据公式纸走即可,除了一开始的 signed test 没有:
Let $ S = \min(\text{number of } + \text{ signs},\ \text{number of } - \text{ signs}) $, then
$ \mathbb{E}(S) = \frac{n}{2},\ \mathrm{Var}(S) = \frac{n}{4} $.
For large $ n (> 10) $, $ T \sim \mathcal{N}\left( \frac{n}{2}, \frac{n}{4} \right) $, we can use the normal approximation of the binomial with $ p = 0.5 $. We must also make sure that we use a continuity correction. As we are approximating a discrete distribution with a continuous distribution, our z-value is: $$\begin{aligned}&= z \ &= \frac{S^+ - \mu + 0.5}{\sigma}\end{aligned}$$