📚 Testing a Poisson Distribution as a Model | 检验泊松分布作为模型
A Poisson distribution is often used to model the number of times an event occurs in a fixed interval of time or space. Before using the model for predictions, we should test whether observed data are actually consistent with a Poisson distribution.
泊松分布常用于模拟固定时间或空间间隔内事件发生的次数。在将模型用于预测之前,我们应当检验观测数据是否真的与泊松分布一致。
This article explains the chi-squared goodness-of-fit test for a Poisson model, which is a key skill in the Edexcel AS Statistics specification.
本文讲解如何用卡方拟合优度检验来检验泊松模型,这是 Edexcel AS 统计学大纲中的一项重要技能。
1. Why We Test a Poisson Model | 为什么要检验泊松模型
In many real-world situations we assume that a random variable X follows a Poisson distribution, written X ~ Po(λ). For example, the number of calls arriving at a call centre per hour, or the number of accidents at a junction per week, may be modelled by a Poisson distribution.
在许多实际问题中,我们会假设随机变量 X 服从泊松分布,记为 X ~ Po(λ)。例如,每小时打入呼叫中心的电话数,或某路口每周的事故数,都可以用泊松分布来建模。
However, a modelling assumption is not automatically correct. The chi-squared goodness-of-fit test provides a formal way to check whether the observed frequencies differ significantly from the frequencies predicted by the Poisson model.
然而,模型假设并不一定正确。卡方拟合优度检验提供了一种正式方法,用来判断观测频数与泊松模型预测的频数之间是否存在显著差异。
If the difference is too large, we conclude that the Poisson model is not suitable; if the difference is small, we do not reject the model.
如果差异过大,我们判定泊松模型不适用;如果差异较小,则不拒绝该模型。
2. Recalling the Poisson Conditions | 回顾泊松条件
Before carrying out a goodness-of-fit test, it is useful to recall the conditions required for a Poisson model.
在进行拟合优度检验之前,先回顾泊松模型所需的条件会很有帮助。
-
Events in non-overlapping intervals are independent.
在不重叠的时间或空间区间内,事件是相互独立的。
-
Events occur one at a time; simultaneous occurrences are negligible.
事件逐次发生,同时发生的概率可忽略。
-
The mean rate of occurrence λ is constant over the interval being studied.
在研究的区间内,平均发生率 λ 保持不变。
-
The number of events has no upper limit, although very large values become highly unlikely.
事件发生次数没有上限,但很大值的概率极低。
In an exam, you do not need to prove all of these conditions every time, but you should be able to identify whether a Poisson model is plausible before testing it.
在考试中,你不必每次都证明所有条件,但在检验之前应能判断泊松模型是否合理。
3. Hypotheses for Goodness of Fit | 拟合优度的假设
Every goodness-of-fit test starts with a null hypothesis and an alternative hypothesis.
每一个拟合优度检验都以原假设和备择假设开头。
For testing a Poisson distribution, the hypotheses are:
检验泊松分布时,假设为:
H₀: The data follow a Poisson distribution, X ~ Po(λ)
H₀:数据服从泊松分布,即 X ~ Po(λ)
H₁: The data do not follow a Poisson distribution
H₁:数据不服从泊松分布
The parameter λ is usually not known, so we estimate it from the sample data before calculating expected frequencies.
参数 λ 通常是未知的,因此我们在计算期望频数之前,先从样本数据中估计它。
4. From Raw Data to a Frequency Table | 从原始数据到频数表
The first step is to summarise the observed data in a frequency table. The first column lists the possible values r = 0, 1, 2, 3, … and the second column lists the observed frequencies O.
第一步是将观测数据汇总成频数表。第一列列出可能的取值 r = 0, 1, 2, 3, …,第二列列出观测频数 O。
For example, suppose we record the number of hurricanes hitting a coastal town per year for 60 years.
例如,假设我们记录了一个沿海城镇 60 年内每年遭受飓风袭击的次数。
| Number of hurricanes in a year, r | Observed frequency, O |
|---|---|
| 0 | 17 |
| 1 | 22 |
| 2 | 12 |
| 3 | 6 |
| 4 | 2 |
| 5 | 1 |
| 6 or more | 0 |
The total sample size is n = 17 + 22 + 12 + 6 + 2 + 1 + 0 = 60 years.
样本总容量为 n = 17 + 22 + 12 + 6 + 2 + 1 + 0 = 60 年。
5. Estimating λ from the Sample | 用样本估计 λ
If λ is not given, we estimate it using the sample mean. For a frequency table, the estimate is:
如果 λ 未给出,我们用样本均值来估计它。对于频数表,估计公式为:
λ̂ = x̄ = Σ(r × O) / n
λ̂ = x̄ = Σ(r × O) / n
For our hurricane data, the calculation is:
对于飓风数据,计算如下:
λ̂ = (0×17 + 1×22 + 2×12 + 3×6 + 4×2 + 5×1) / 60 = 77 / 60 = 1.2833
λ̂ = (0×17 + 1×22 + 2×12 + 3×6 + 4×2 + 5×1) / 60 = 77 / 60 = 1.2833
We therefore use λ = 1.2833 when calculating expected probabilities.
因此,在计算期望概率时我们使用 λ = 1.2833。
6. Calculating Expected Frequencies | 计算期望频数
Under the null hypothesis, the probability that X takes a particular value r is given by the Poisson probability formula:
在原假设下,X 取某个特定值 r 的概率由泊松概率公式给出:
P(X = r) = e⁻λ λʳ / r!
P(X = r) = e⁻λ λʳ / r!
The expected frequency for each value r is found by multiplying the probability by the total sample size:
每个值 r 的期望频数等于该概率乘以样本总容量:
E = n × P(X = r)
E = n × P(X = r)
Using λ = 1.2833 and n = 60, the expected frequencies are approximately:
使用 λ = 1.2833 和 n = 60,期望频数近似为:
| Number of hurricanes, r | Observed frequency, O | Expected frequency, E |
|---|---|---|
| 0 | 17 | 16.64 |
| 1 | 22 | 21.36 |
| 2 | 12 | 13.70 |
| 3 | 6 | 5.86 |
| 4 | 2 | 1.88 |
| 5 | 1 | 0.48 |
| 6 or more | 0 | 0.06 |
Notice that some expected frequencies are very small, so we will need to combine categories before calculating the test statistic.
注意有些期望频数非常小,因此在计算检验统计量之前,需要先合并类别。
7. The Chi-Squared Statistic | 卡方统计量
The chi-squared goodness-of-fit test measures how far the observed frequencies are from the expected frequencies.
卡方拟合优度检验衡量观测频数与期望频数之间的差距有多大。
The test statistic is:
检验统计量为:
χ² = Σ (O − E)² / E
χ² = Σ (O − E)² / E
Here, O is the observed frequency in each combined category, E is the corresponding expected frequency, and the sum is taken over all categories.
其中,O 是每个合并类别中的观测频数,E 是相应的期望频数,求和覆盖所有类别。
A large value of χ² indicates a large discrepancy between the data and the Poisson model, while a small value suggests that the model fits well.
χ² 值较大表示数据与泊松模型之间存在较大差异,而 χ² 值较小则表明模型拟合较好。
8. Degrees of Freedom | 自由度
The degrees of freedom for the chi-squared test depend on the number of categories and the number of parameters estimated from the data.
卡方检验的自由度取决于类别数量以及从数据中估计的参数个数。
If there are k categories after combining, and m parameters have been estimated from the sample, then:
如果合并后有 k 个类别,并且从样本中估计了 m 个参数,那么:
Degrees of freedom ν = k − 1 − m
自由度 ν = k − 1 − m
For a Poisson model where λ is estimated from the data, we have m = 1, so:
对于从数据中估计 λ 的泊松模型,我们有 m = 1,因此:
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply