跳到主要内容

进阶概率与统计

A-Level 进阶数学 · 第 4 主题

训练
讲义 词汇表

这份讲义涵盖主题 4:进阶概率统计(Further Probability & Statistics)。它增加连续分布、小样本推断、卡方和非参数检验,以及概率母函数。

4.1

连续随机变量

大纲
Candidates should be able to: Notes and examples
use a probability density function which may be defined piecewise
use the general result $\text{E}(g(X)) = \int f(x)g(x) \, \mathrm{d}x$ where $f(x)$ is the probability density function of the continuous random variable $X$ and $g(X)$ is a function of $X$
understand and use the relationship between the probability density function (PDF) and the cumulative distribution function (CDF), and use either to evaluate probabilities or percentiles
use cumulative distribution functions (CDFs) of related variables in simple cases. e.g. given the CDF of a variable $X$, find the CDF of a related variable $Y$, and hence its PDF, e.g. where $Y = X^3$.

来源:剑桥国际大纲

一个连续变量 $X$ 由一个概率密度函数(probability density function)$f(x)$ 描述,它可能被分段定义。一个范围上的概率是 $f$ 下的面积,而 $X$ 的任何函数的平均值是

$$E(g(X)) = \int g(x)\,f(x)\,dx.$$

一个密度,中位数左边的面积被着色为一半
中位数坐落在它左边 $f(x)$ 下的面积恰好是 $0.5$ 的地方。

累积分布函数(cumulative distribution function)$F(x) = P(X \leqslant x)$ 是累加的总数:$F(x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt$,而 $f(x) = F'(x)$。用 $F$ 求概率和百分位数(percentiles,例如中位数(median)解 $F(x) = 0.5$)。

一条从 0 到 1 上升的累积曲线,中位数在高度 0.5 处读出
累积图 $F(x)$$0$ 上升到 $1$;高度 $0.5$ 在中位数处到达。

例题。 一个变量对 $0 \leqslant x \leqslant 2$$f(x) = \tfrac12 x$。求中位数。

累积分布函数是 $F(x) = \displaystyle\int_0^x \tfrac12 t\,dt = \tfrac14 x^2$。令 $F(m) = 0.5$:

$$\tfrac14 m^2 = 0.5 \;\Rightarrow\; m^2 = 2 \;\Rightarrow\; m = \sqrt{2} = 1.41.$$

一个相关变量的分布。$Y=g(X)$,通过它的累积函数求 $Y$ 的分布。对 $Y=X^2$:$F_Y(y)=P(X^2\leqslant y)=P(-\sqrt y\leqslant X\leqslant\sqrt y)=F_X(\sqrt y)-F_X(-\sqrt y)$,然后微分得 $f_Y=F_Y'$。当 $g$ 单调递增时有一个捷径,$F_Y(y)=F_X\big(g^{-1}(y)\big)$

例题。$f_X(x)=\tfrac12 x$$[0,2]$ 上(所以 $F_X(x)=\tfrac14 x^2$),令 $Y=X^2$。对 $0\leqslant y\leqslant 4$,$F_Y(y)=F_X(\sqrt y)=\tfrac14 y$,所以 $f_Y(y)=F_Y'(y)=\tfrac14$——就是说 $Y$$[0,4]$ 上均匀分布。

探索

Continuous random variables

P(a < X < b) = ∫ f(x) dx

For a continuous variable, probability is the area under the density curve.

词汇表 训练
英文 中文 拼音
probability density function 概率密度函数 gài lǜ mì dù hán shù
cumulative distribution function 累积分布函数 lěi jī fēn bù hán shù
percentiles 百分位数 bǎi fēn wèi shù
median 中位数 zhōng wèi shù
4.2

利用正态分布与t分布的推断

大纲
Candidates should be able to: Notes and examples
formulate hypotheses and apply a hypothesis test concerning the population mean using a small sample drawn from a normal population of unknown variance, using a t-test
calculate a pooled estimate of a population variance from two samples Calculations based on either raw or summarised data may be required.
formulate hypotheses concerning the difference of population means, and apply, as appropriate: - a 2-sample t-test - a paired sample t-test - a test using a normal distribution The ability to select the test appropriate to the circumstances of a problem is expected.
determine a confidence interval for a population mean, based on a small sample from a normal population with unknown variance, using a t-distribution
determine a confidence interval for a difference of population means, using a t-distribution or a normal distribution, as appropriate.

来源:剑桥国际大纲

一个高尔顿板,球堆积成一个钟形
一个高尔顿板:球穿过钉子下落堆积成钟形的正态分布。

当一个样本小而总体方差未知时,把你的假设检验(hypothesis test)建立在 $t$ 分布而不是正态上。同样的思想给出平均值的一个置信区间(confidence interval):

$$\bar{x} \pm t\,\frac{s}{\sqrt{n}},$$
其中 $t$ 来自带 $n - 1$ 自由度的 $t$ 表。要比较两个总体,用一个双样本(2-sample)或配对样本 $t$ 检验,在适当时找到共享方差的一个合并估计(pooled estimate)之后。

 分布曲线坐得比标准正态更低、更宽
对一个小样本,$t$ 分布更平、尾更重,所以它的临界值更大。

例题。 一个 $n = 10$ 的样本有平均值 $\bar{x} = 50$ 和标准差 $s = 4$。求平均值的一个 $95\%$ 置信区间(对 $9$ 个自由度用 $t = 2.262$)。

$$50 \pm 2.262\times\frac{4}{\sqrt{10}} = 50 \pm 2.86 \;\Rightarrow\; (47.1,\ 52.9).$$

探索

Why small samples need t instead of z

With $\sigma$ unknown you use $t$, and $t$ has heavier tails than the normal (drawn dashed behind it) — so its critical values are larger and the interval is wider. At the worked example's $9$ degrees of freedom the widget reads $t^* = 2.262$, exactly the table value used above. Sweep df up and $t$ collapses onto the normal.

探索

The normal distribution

Shade a tail to find a probability — the basis of confidence intervals and hypothesis tests.

词汇表 训练
英文 中文 拼音
hypothesis test 假设检验 jiǎ shè jiǎn yàn
confidence interval 置信区间 zhì xìn qū jiān
pooled estimate 合并估计 hé bìng gū jì
4.3

卡方检验

大纲
Candidates should be able to: Notes and examples
fit a theoretical distribution, as prescribed by a given hypothesis, to given data Questions will not involve lengthy calculations.
use a $\chi^2$-test, with the appropriate number of degrees of freedom, to carry out the corresponding goodness of fit analysis Classes should be combined so that each expected frequency is at least 5.
use a $\chi^2$-test, with the appropriate number of degrees of freedom, for independence in a contingency table. Yates’ correction is not required. Where appropriate, either rows or columns should be combined so that the expected frequency in each cell is at least 5.

来源:剑桥国际大纲

一个 $\chi^2$ 检验(卡方检验(chi-squared test))把观察计数 $O$ 与一个理论分布(theoretical distribution)的预期计数 $E$ 比较:

$$\chi^2 = \sum \frac{(O - E)^2}{E}.$$
把这个与正确数目的自由度(degrees of freedom)的一个表值比较。两个用途:一个拟合优度(goodness of fit)检验(数据是否跟随提议的模型?),以及一个列联表(contingency table)中两个变量的独立性(independence)检验。

一条右偏的卡方曲线,它上方 5% 的尾在临界值之外被着色
$\chi^2$ 超过临界值、落入着色的 $5\%$ 尾时,检验拒绝模型。

例题。 四个等可能的类别给出观察计数 $20, 30, 25, 25$(所以每个预期计数是 $25$)。在 $5\%$ 水平检验拟合。

$$\chi^2 = \frac{(20-25)^2 + (30-25)^2 + 0 + 0}{25} = \frac{25 + 25}{25} = 2.$$
$4 - 1 = 3$ 个自由度,表值是 $7.815$。因为 $2 < 7.815$,不拒绝模型。

探索

The chi-squared distribution and its 5% tail

The worked example on this page gives $\chi^2 = 2$ with $3$ degrees of freedom against a table value of $7.815$ — the widget reproduces both. Drag df to see why the critical value changes with the number of categories.

探索

Chi-squared test route

Follow observed and expected counts to a test decision.

词汇表 训练
英文 中文 拼音
chi-squared test 卡方检验 kǎ fāng jiǎn yàn
theoretical distribution 理论分布 lǐ lùn fēn bù
degrees of freedom 自由度 zì yóu dù
goodness of fit 拟合优度 nǐ hé yōu dù
independence 独立性 dú lì xìng
contingency table 列联表 liè lián biǎo
4.4

非参数检验

大纲
Candidates should be able to: Notes and examples
understand the idea of a non-parametric test and appreciate situations in which such a test might be useful e.g. when sampling from a population which cannot be assumed to be normally distributed.
understand the basis of the sign test, the Wilcoxon signed-rank test and the Wilcoxon rank-sum test Including knowledge that Wilcoxon tests are valid only for symmetrical distributions.
use a single-sample sign test and a single-sample Wilcoxon signed-rank test to test a hypothesis concerning a population median Including the use of normal approximations where appropriate. Questions will not involve tied ranks or observations equal to the population median value being tested.
use a paired-sample sign test, a Wilcoxon matched-pairs signed-rank test and a Wilcoxon rank-sum test, as appropriate, to test for identity of populations. Including the use of normal approximations where appropriate. Questions will not involve tied ranks or zero‑difference pairs.

来源:剑桥国际大纲

一个非参数检验(non-parametric test)不假设数据是正态的,所以当那个假设失败时它有用。基本的是:

  • 符号检验(sign test):数有多少值落在一个提议的中位数之上和之下,并用一个二项模型检验那些计数;
  • 威尔科克森符号秩检验(Wilcoxon signed-rank test,配对数据的匹配对检验),它也用差的大小,而不只是它们的符号;
  • 威尔科克森秩和检验(Wilcoxon rank-sum test),用于比较两个分开的样本。
一条数轴,带一个虚线中位数:它下面的三个点被标为减,它上面的四个被标为加
符号检验数有多少值落在提议的中位数之上和之下,然后用一个二项模型检验那些计数

例题。 检验一个中位数是否是 $5$。在一个 $10$ 个值的样本中(没有等于 $5$ 的),$9$ 个在 $5$ 之上$1$ 个在它之下。在 $5\%$ 水平检验(双尾)。

$H_0$(中位数 $= 5$)下,之上的数目跟随 $B(10, 0.5)$。观察结果($9$ 个在上)是极端的,所以求 $P(X \geq 9) = \binom{10}{9}(0.5)^{10} + (0.5)^{10} = \dfrac{11}{1024} = 0.0107$。对一个双尾检验与 $\tfrac{1}{2}(5\%) = 0.025$ 比较。因为 $0.0107 < 0.025$,拒绝 $H_0$:有证据表明中位数不是 $5$

探索

Non-parametric test chooser

Choose the rank-based test that matches the data situation.

词汇表 训练
英文 中文 拼音
non-parametric test 非参数检验 fēi cān shù jiǎn yàn
sign test 符号检验 fú hào jiǎn yàn
Wilcoxon signed-rank test 威尔科克森符号秩检验 wēi ěr kē kè sēn fú hào zhì jiǎn yàn
Wilcoxon rank-sum test 威尔科克森秩和检验 wēi ěr kē kè sēn zhì hé jiǎn yàn
4.5

概率母函数

大纲
Candidates should be able to: Notes and examples
understand the concept of a probability generating function (PGF) and construct and use the PGF for given distributions Including the discrete uniform, binomial, geometric and Poisson distributions.
use formulae for the mean and variance of a discrete random variable in terms of its PGF, and use these formulae to calculate the mean and variance of a given probability distribution
use the result that the PGF of the sum of independent random variables is the product of the PGFs of those random variables.

来源:剑桥国际大纲

一堆多面体骰子
骰子:概率和离散随机变量的一个起点。

一个离散变量 $X$概率母函数(probability generating function)是

$$G(t) = E(t^X) = \sum_x P(X = x)\,t^x.$$
它把整个分布装进一个函数。平均值和方差来自它在 $t = 1$ 处的导数:$E(X) = G'(1)$$\mathrm{Var}(X) = G''(1) + G'(1) - \big(G'(1)\big)^2$。而且,独立变量之和的 PGF 是它们 PGF 的乘积。

例题。 $X$$P(X=0) = 0.5$$P(X=1) = 0.3$$P(X=2) = 0.2$。用 PGF 求 $E(X)$

这里 $G(t) = 0.5 + 0.3t + 0.2t^2$,所以 $G'(t) = 0.3 + 0.4t$

$$E(X) = G'(1) = 0.3 + 0.4 = 0.7.$$

公平骰子的概率母函数把 1 到 6 上的等质量装进 G(t)
公平骰子的概率母函数把 1 到 6 上的等质量装进 G(t)
探索

Probability generating function lab

G(x) = p0 + p1 x + p2 x^2 + ...

Change x and see how a PGF stores probabilities in powers of x.

词汇表 训练
英文 中文 拼音
probability generating function 概率母函数 gài lǜ mǔ hán shù
Further Probability & Statistics 进阶概率统计 jìn jiē gài lǜ tǒng jì
4.5

考试技巧

  • 对于一个连续型随机变量,pdf 在它的范围上积分为 $1$,而 $E(X) = \int x f(x)\,dx$
  • 当样本小而总体方差未知时用 $t$ 分布;陈述自由度。
  • 对一个卡方检验计算 $\sum (O-E)^2/E$、与正确自由度的临界值比较,并合并 $E < 5$ 的类别
  • 为每个检验陈述 $H_0$$H_1$结合上下文给出结论。

本主题的互动课程

逐步学习,并即时检测练习。

A-Level 进阶数学的更多主题

登录或创建账号

IGCSE, A-Level & AP