Residuals in Regression: What They Tell Us About Fit | 回归中的残差:它们如何揭示拟合程度

📚 Residuals in Regression: What They Tell Us About Fit | 回归中的残差:它们如何揭示拟合程度

In Edexcel A Level Mathematics, residuals are the vertical differences between observed data points and the values predicted by a regression line. They are one of the most useful diagnostic tools in statistics because they show whether a linear model is appropriate and whether any individual point is unusual.

在爱德思 A Level 数学中,残差是观测数据点与回归直线预测值之间的垂直差异。它们是统计学中最有用的诊断工具之一,因为残差可以显示线性模型是否合适,以及是否存在个别异常点。


1. What is a Residual? | 什么是残差?

For a bivariate data point (xᵢ, yᵢ), if the regression line gives a predicted value ŷᵢ = a + bxᵢ, then the residual is defined as rᵢ = yᵢ − ŷᵢ. It measures the vertical error only, not the horizontal distance from the line.

对于双变量数据点 (xᵢ, yᵢ),如果回归直线给出的预测值为 ŷᵢ = a + bxᵢ,则残差定义为 rᵢ = yᵢ − ŷᵢ。它只测量垂直方向上的误差,而不是到直线的水平距离。

rᵢ = yᵢ − ŷᵢ = yᵢ − (a + bxᵢ)

In this formula, yᵢ is the observed response value, ŷᵢ is the fitted value from the regression line, and rᵢ is the leftover piece that the model could not explain.

在这个公式中,yᵢ 是观测到的响应值,ŷᵢ 是回归直线给出的拟合值,而 rᵢ 是模型未能解释的剩余部分。


2. Why Residuals Matter | 残差为何重要

A regression line is a summary of the relationship between two variables, but it does not pass through every point. Residuals show the leftover variation that the model has not explained, and analysing them helps us judge whether the line is a sensible model.

回归直线是对两个变量之间关系的一种概括,但它并不会经过每一个点。残差显示了模型尚未解释的剩余变异,分析残差可以帮助我们判断这条直线是否是一个合理的模型。

If the residuals are small and have no clear pattern, the linear model is likely to be suitable. If they are large or form a pattern, we may need a curve or a different transformation.

如果残差很小并且没有明显的模式,那么线性模型很可能是合适的。如果残差很大或形成某种模式,我们可能需要一条曲线或进行不同的变换。


3. Calculating Residuals from a Regression Line | 根据回归直线计算残差

To calculate a residual, first substitute xᵢ into the regression equation to find the predicted value ŷᵢ. Then subtract this predicted value from the observed yᵢ: rᵢ = yᵢ − ŷᵢ.

要计算残差,首先将 xᵢ 代入回归方程,求出预测值 ŷᵢ。然后用观测值 yᵢ 减去该预测值:rᵢ = yᵢ − ŷᵢ。

xᵢ yᵢ ŷᵢ = 1.2 + 2.0xᵢ rᵢ = yᵢ − ŷᵢ
1 3 3.2 −0.2
2 5 5.2 −0.2
3 8 7.2 0.8
4 9 9.2 −0.2
5 11 11.2 −0.2

In this table, each residual is the vertical gap between the observed point and the regression line. Notice that the residuals sum to zero, which is a property of the least squares regression line.

在这个表格中,每个残差都是观测点与回归直线之间的垂直差距。请注意,这些残差之和为零,这是最小二乘回归直线的一个性质。


4. Positive and Negative Residuals | 正残差与负残差

If yᵢ is greater than ŷᵢ, the residual is positive and the point lies above the regression line. If yᵢ is less than ŷᵢ, the residual is negative and the point lies below the line.

如果 yᵢ 大于 ŷᵢ,则残差为正,该点位于回归直线的上方。如果 yᵢ 小于 ŷᵢ,则残差为负,该点位于回归直线的下方。

A residual of zero means the point lies exactly on the fitted line. Positive and negative residuals should usually be mixed around the line rather than all on one side.

残差为零意味着该点恰好位于拟合直线上。正残差和负残差通常应围绕直线混合分布,而不是全部位于同一侧。


5. Residual Sum of Squares (RSS) | 残差平方和

The residual sum of squares is the sum of the squared residuals: RSS = Σ rᵢ² = Σ (yᵢ − ŷᵢ)². Squaring means positive and negative residuals do not cancel out, so RSS measures the total size of all residuals.

残差平方和是残差平方的总和:RSS = Σ rᵢ² = Σ (yᵢ − ŷᵢ)²。平方后正残差和负残差不会相互抵消,因此 RSS 衡量的是所有残差的总大小。

RSS = Σ (yᵢ − ŷᵢ)²

The smaller the RSS, the closer the regression line is to the data points. In least squares regression, the coefficients a and b are chosen to make RSS as small as possible.

RSS 越小,回归直线就越接近数据点。在最小二乘回归中,系数 a 和 b 的选择应使 RSS 尽可能小。


6. Least Squares Regression and Residuals | 最小二乘法与残差

The least squares regression line is the line that minimises the sum of squared residuals. This means residuals are not simply ignored; they define how the regression line is fitted to the data.

最小二乘回归直线是使残差平方和最小的直线。这意味着残差并非被忽略,而是决定了回归直线如何拟合数据。

For the least squares line, the sum of the residuals is always zero. This gives the line a balancing property: the total overshoot above the line equals the total undershoot below the line.

对于最小二乘直线,残差之和始终为零。这赋予了直线一种平衡性质:直线上方的总超出量等于直线下方的总不足量。


7. Constructing a Residual Plot | 绘制残差图

A residual plot is a scatter graph of residuals on the vertical axis against either the x values or the predicted values ŷ on the horizontal axis. A horizontal reference line is usually drawn at residual = 0.

残差图是以残差为纵轴、以 x 值或预测值 ŷ 为横轴的散点图。通常会在残差 = 0 处画一条水平参考线。

In Edexcel questions, you may be asked to plot residuals or to describe what a given residual plot shows. Always label the residual axis and the zero line clearly.

在爱德思考试题中,你可能会被要求绘制残差图,或描述给定的残差图显示了什么。请务必清楚地标记残差轴和零线。


8. Interpreting Residual Plots: Random Scatter | 解释残差图:随机散布

If the residual plot shows no clear pattern and the points are randomly scattered above and below the line residual = 0, the linear model is appropriate. The vertical spread of the residuals should remain roughly constant as x increases.

如果残差图没有显示明显的模式,并且这些点随机地散布在残差 = 0 这条线的上方和下方,那么线性模型是合适的。随着 x 的增大,残差的垂直分布应大致保持不变。

  • Random scatter above and below zero indicates a good linear fit.
  • 随机散布在零线上下表明线性拟合良好。
  • Roughly constant spread indicates that the model’s accuracy is similar for all x values.
  • 大致恒定的散布表明模型在所有 x 值上的准确性相似。

9. Patterns That Suggest a Poor Linear Fit | 表明线性拟合不佳的模式

A curved pattern in the residual plot, such as a U-shape or an n-shape, suggests that the relationship between the variables is not linear. A curve in the original scatter graph may be hidden until the residuals are plotted.

残差图中的弯曲模式,例如 U 形或倒 U 形,表明变量之间的关系不是线性的。原始散点图中的曲线在绘制残差图之前可能并不明显。

A fan shape, where residuals spread out more as x increases, indicates non-constant variance. A linear trend in the residual plot can also suggest that the model has been mis-specified and a different line or transformation is needed.

扇形模式,即残差随着 x 增大而分布越来越宽,表明方差不恒定。残差图中的线性趋势也可能表明模型设定有误,需要不同的直线或进行变换。


10. Residuals and Outliers | 残差与离群值

A point with a large residual, either positive or negative, may be an outlier. In a residual plot, an outlier appears as a point far from the zero line compared with the other residuals.

具有较大残差的点,无论是正残差还是负残差,都可能是离群值。在残差图中,离群值表现为与其他残差相比远离零线的点。

In Edexcel questions, you may be asked to identify an outlier from a residual plot and explain its effect on the regression line. An outlier can pull the least squares line away from the main pattern of the data.

在爱德思考试题中,你可能会被要求从残差图中识别离群值,并解释它对回归直线的影响。离群值可能会把最小二乘直线拉离数据的主要模式。


11. Worked Example | 例题

Consider the data set x = 1, 2, 3, 4, 5 and y = 3, 5, 8, 9, 11. The least squares regression line is ŷ = 1.2 + 2.0x. Calculate the residuals and interpret them.

考虑数据集 x = 1、2、3、4、5 和 y = 3、5、8、9、11。最小二乘回归直线为 ŷ = 1.2 + 2.0x。计算残差并解释它们。

xᵢ yᵢ ŷᵢ = 1.2 + 2.0xᵢ rᵢ = yᵢ − ŷᵢ
1 3 3.2 −0.2
2 5 5.2 −0.2
3 8 7.2 0.8
4 9 9.2 −0.2
5 11 11.2 −0.2

The residuals are −0.2, −0.2, 0.8, −0.2 and −0.2. Their sum is 0, confirming the least squares property. The residual plot would show most points close to zero, with one larger positive residual at x = 3.

残差为 −0.2、−0.2、0.8、−0.2 和 −0.2。它们的总和为 0,验证了最小二乘性质。残差图将显示大多数点接近零线,在 x = 3 处有一个较大的正残差。


12. Exam Tips for Edexcel | 爱德思考试技巧

In Edexcel exams, you may be given a regression line and asked to calculate residuals. Always state the units if the variables have units, and show your subtraction clearly.

在爱德思考试中,你可能会得到一条回归直线,并被要求计算残差。如果变量有单位,请务必注明单位,并清楚地展示减法过程。

When commenting on a residual plot, use precise language such as ‘random scatter’, ‘no clear pattern’, ‘constant spread’ or ‘curved pattern’. Do not claim the line is a good fit if the residuals show a clear curve.

在评述残差图时,请使用准确的语言,例如“随机散布”、“无明显模式”、“恒定散布”或“弯曲模式”。如果残差显示出明显的曲线,不要声称直线拟合良好。

Published by TutorHao | Mathematics Revision Series | aleveler.com

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

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading