← 返回资讯屏轩教育 · 行业资讯

Residuals | 残差

2026-08-02 17:01 · 本文部分内容由AI辅助创作

📚 Residuals | 残差

In regression analysis, after fitting a line or curve to a set of data points, the differences between the observed values and the values predicted by the model are called residuals. These seemingly simple leftovers hold the key to assessing whether the chosen model is appropriate, detecting outliers, and checking assumptions such as constant variance and linearity. Mastering residuals is essential for any A-Level Statistics student aiming to build robust statistical models and interpret data correctly.

在回归分析中,当我们为一组数据点拟合一条直线或曲线后,观测值与模型预测值之间的差异就称为残差。这些看似简单的“剩余部分”是评估所选模型是否合适、检测异常值以及检验常数方差和线性等假设的关键。掌握残差知识对于任何想要构建稳健统计模型并正确解读数据的 A-Level 统计学学生来说都至关重要。

1. What Are Residuals? | 什么是残差?

regression line. For a given data point (xᵢ, yᵢ), the residual eᵢ is defined as eᵢ = yᵢ − ŷᵢ, where ŷ ; if smaller, the residual is negative. Residuals are not errors in the sense of mistakes, but rather the natural variation that the model cannot explain.

残差是实际数据点与回归线之间的垂直偏差。对于给定的数据点 (xᵢ, yᵢ),残差 eᵢ 定义为 eᵢ = yᵢ − ŷᵢ,其中 ŷᵢ 是根据回归方程对 xᵢ 的预测值。如果观测值大于预测值,残差为正;小于预测值,则残差为负。残差并不是错误意义上的误差,而是模型无法解释的自然变异。

2. Residuals and the Least Squares Regression Line | 残差与最小二乘回归线

squared residuals (SSR). The equation of the line is y = a + bx, where b = Sₓᵨ/Sₓₓ and a = ȳ − b x̄ ls play a central role in determining the line itself; they are not just by-products but are integral to the fitting criterion.

最小二乘回归线是使残差平方和(SSR)最小的直线。这条直线的方程为 y = a + bx,其中 b = Sₓᵨ/Sₓₓ,a = ȳ − b x̄。通过最小化 Σ eᵢ²,我们确保这条直线在垂直距离上尽可能接近所有数据点。这个过程使得残差在确定直线本身时起到了核心作用;它们不仅仅是副产品,而是拟合准则不可或缺的部分。

3. Calculating Residuals Step by Step | 逐步计算残差

find the equation of the regression line. For each x-value, calculate the predicted value ŷ = a + bx. Then subtract this predicted value from the observed y-value: e = y − ŷ. It is good practice to present the calculations in a table with columns for x, y, ŷ sation helps in later constructing residual plots and identifying any systematic patterns.

要计算一组双变量数据的残差,首先求出回归线的方程。对于每个 x 值,计算预测值 ŷ = a + bx。然后用观测值 y 减去这个预测值:e = y − ŷ。最好将计算过程呈现在一个包含 x、y、ŷ 和 e 列的表里。这样的组织方式有助于后续绘制残差图并识别任何系统性模式。

xyŷ = a + bxe = y − ŷ
132.80.2
244.1−0.1
355.4−0.4

Example table for residual calculation.

残差计算示例表。

4. Properties of Residuals | 残差的性质

properties arise directly from the normal equations used to derive the coefficients a and b. The zero-sum property implies that the mean of residuals is zero, which is a useful check when performing manual calculations. Furthermore, the regression line always passes through the point (x̄, ȳ), and the residuals are uncorrelated with the explanatory variable.

最小二乘回归的残差总和始终为零:Σ eᵢ = 0。同时,x 值与残差乘积的和也为零:Σ xᵢ eᵢ = 0。这些性质直接源自用于推导系数 a 和 b 的正规方程。残差总和为零意味着残差的均值为零,这在手动计算时是一个有用的检验。此外,回归线总是通过点 (x̄, ȳ),并且残差与解释变量之间不相关。

5. Residual Plots (Residuals vs Fitted Values) | 残差图(残差与拟合值)

zontal axis. A well-fitting linear model will show a random scatter of points around the horizontal line e = 0, with no obvious pattern. Curvature, fanning out, or clustering in the residual plot indicates that the linear model may not be appropriate, or that assumptions like homoscedasticity (constant variance) are violated. Plotting residuals is often more informative than looking at the original scatter plot alone.

残差图是将残差画在垂直轴上、预测值(有时也用 x 值)画在水平轴上的散点图。一个拟合良好的线性模型会显示点围绕水平线 e = 0 随机散布,没有明显模式。如果残差图出现弯曲、扇形张开或聚集,则表明线性模型可能不合适,或者常数方差等同方差性假设被违背。绘制残差图通常比只看原始散点图能提供更多信息。

6. Patterns in Residual Plots | 残差图中的模式

Several distinct patterns can appear in residual plots. A curved pattern suggests that the relationship is not linear and a transformation or a polynomial term may be needed. A fan-shaped pattern (increasing or decreasing spread of residuals) indicates heteroscedasticity, meaning the variance of the errors is not constant. Outliers appear as points that are far from the horizontal band. Recognising these patterns enables the modeller to refine the regression model, for example by using a quadratic model or applying a logarithmic transformation.

广告 / Sponsored

残差图中可能出现几种明显的模式。弯曲模式表明关系不是线性的,可能需要变换或添加多项式项。扇形模式(残差的散布递增或递减)表明存在异方差性,即误差的方差不是常数。异常值表现为远离水平带的点。识别这些模式使建模者能够优化回归模型,例如使用二次模型或应用对数变换。

7. Residuals and Outliers | 残差与异常值

An outlier in regression is a point that has an unusually large residual in absolute terms. However, not every large residual necessarily indicates an outlier; it could be a result of high natural variability. To formally identify outliers, standardised residuals or studentised residuals are often used. A common rule of thumb is that any standardised residual with an absolute value greater than 2 or 3 may be considered an outlier. Outliers should be investigated carefully, as they can unduly influence the regression line, especially if they also have high leverage.

回归中的异常值是指残差绝对值异常大的点。然而,并非每个大的残差都一定表示异常值;它可能是高自然变异性的结果。为了正式识别异常值,通常使用标准化残差或学生化残差。常见的经验法则是,任何绝对值大于 2 或 3 的标准化残差可被视为异常值。异常值应仔细检查,因为它们可能会过度影响回归线,特别是如果它们同时具有高杠杆值时。

8. Standardised Residuals | 标准化残差

ual by an estimate of the standard deviation of the residuals. The formula is rᵢ = eᵢ / (s√1 − hᵢᵢ Standardised residuals make it easier to compare residuals on a common scale and to apply normal distribution properties for detecting outliers. They are a key tool in regression diagnostics at a more advanced level.

标准化残差是将每个残差除以残差标准差估计值得到的。公式为 rᵢ = eᵢ / (s√1 − hᵢᵢ),其中 s 是残差标准误,hᵢᵢ 是杠杆值。但大样本下,有时会使用更简单的近似 rᵢ ≈ eᵢ / s。标准化残差使得在共同的尺度上比较残差以及应用正态分布性质检测异常值变得更加容易。它们是更高级回归诊断中的关键工具。

9. Sum of Squared Residuals (SSR) and Model Fit | 残差平方和 (SSR) 与模型拟合度

The sum of squared residuals, SSR = Σ (yᵢ − ŷ he residual variance and the coefficient of determination R². R² = 1 − SSR/SST, where SST is the total sum of squares. A high R² (close to 1) suggests that the model explains a large proportion of the variation in the response variable. However, a low SSR does not guarantee that the model is correct; residual plots must still be examined.

残差平方和 SSR = Σ (yᵢ − ŷᵢ)² 是衡量回归线对数据拟合程度的指标。SSR 越小表示拟合越紧密。在 Edexcel A-Level 的学习中,SSR 被用来计算残差方差和决定系数 R²。R² = 1 − SSR/SST,其中 SST 是总平方和。高 R²(接近 1)表明模型可以解释响应变量变异的很大一部分。然而,低 SSR 并不能保证模型是正确的;残差图仍需仔细检查。

10. Residuals in Context: Checking Assumptions | 情境中的残差:检验假设

Linear regression relies on several assumptions: linearity, independence, constant variance (homoscedasticity), and normality of residuals (for inference). Residual plots are the most effective way to check these assumptions collectively. A random scatter supports linearity and homoscedasticity. A histogram or normal probability plot of residuals can be used to assess normality. In Edexcel A-Level examinations, you may be asked to comment on the suitability of a linear model based on a given residual plot, so it is crucial to be able to describe what you see and link it to the assumptions.

线性回归依赖于几个假设:线性、独立性、常数方差(同方差性)和残差的正态性(用于推断)。残差图是整体检验这些假设的最有效方法。随机散布支持线性和同方差性。残差的直方图或正态概率图可用于评估正态性。在 Edexcel A-Level 考试中,你可能会被要求根据给定的残差图评论线性模型的适用性,因此能够描述你所看到的并将其与假设联系起来至关重要。

11. Worked Example: Edexcel-Style Question | 例题:Edexcel 风格问题

, (3, 15), (5, 22), (1, 9), (4, 19), (6, 26). Compute the residuals, comment on the fit, and sketch a residual plot. Predicted values: 2→12.0, 3→15.4, 5→22.2, 1→8.6, 4→18.8, 6→25.6. Residuals: 0, −0.4, −0.2, 0.4, 0.2, 0.4. The residuals are small and appear random, suggesting a good linear fit. The residual plot would show points randomly scattered around zero with no pattern.

一个学生记录了六名学生的复习时数 (x) 和测试成绩 (y)。回归线为 y = 5.2 + 3.4x。数据:(2, 12), (3, 15), (5, 22), (1, 9), (4, 19), (6, 26)。计算残差,评论拟合情况,并绘制残差图草图。预测值:2→12.0, 3→15.4, 5→22.2, 1→8.6, 4→18.8, 6→25.6。残差:0, −0.4, −0.2, 0.4, 0.2, 0.4。残差很小且显得随机,表明线性拟合良好。残差图将显示点围绕零随机散布,没有模式。

12. Common Misconceptions and Pitfalls | 常见误解与陷阱

One common mistake is confusing residuals with errors. Errors are the theoretical differences between the observed values and the true population regression line, while residuals are the observed sample-based estimates of those errors. Another pitfall is ignoring dependence: if residuals show a time sequence pattern, it could indicate that the assumption of independence is violated. Some students also incorrectly assume that a small sum of squared residuals always implies the model is appropriate. Always combine numerical measures with diagnostic plots to draw a reliable conclusion about model adequacy.

一个常见错误是混淆残差与误差。误差是观测值与真实总体回归线之间的理论差异,而残差是基于样本的这些误差的观测估计。另一个陷阱是忽略相依性:如果残差显示出时间序列模式,则可能表明独立性假设被违背。一些学生还错误地认为小的残差平方和总意味着模型是合适的。请务必将数值度量与诊断图结合起来,就模型的充分性得出可靠结论。

Published by TutorHao | Mathematics Revision Series | aleveler.com

广告 / Sponsored
现货 Cambridge International AS & ALevel IT Coursebook剑桥国际IGC…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥467.0

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao