残差
引入本课内容
| English | 释义 | 拼音 |
|---|---|---|
| residual/rɪˈsɪdʒuːəl/ | 残差 | cán chà |
| data point | 数据点 | shù jù diǎn |
| regression line/rɪˈɡreʃn laɪn/ | 回归直线 | huí guī zhí xiàn |
| residual plot/rɪˈsɪdʒuːəl plɒt/ | 残差图 | cán chà tú |
| scatterplot/ˈskætəplɒt/ | 散点图 | sàn diǎn tú |
| non-linear | 非线性 | fēi xiàn xìng |
| linear mean model | 线性均值模型 | xiàn xìng jūn zhí mó xíng |
| Least-squares regression/liːst skweəz rɪˈɡreʃn/ | 最小二乘回归 | zuì xiǎo èr chéng huí guī |
| linear model/ˈlɪnɪə ˈmɒdl/ | 线性模型 | xiàn xìng mó xíng |
每次预测错了多少?
- 残差是剩下的部分:观测值减去预测值,$y - \hat{y}$。
- 它是数据点与回归直线之间的竖直距离。
- 正残差:点位于线上方(模型低估了)。
- 负残差:点位于线下方(模型高估了)。
残差图
- 残差图把残差($y$ 轴)对 $x$(或对 $\hat{y}$)作图。
- 它放大了原散点图上肉眼没有发现的剩余规律。
- 每个点的高度表示那次预测偏离了多少。
- 残差为 $=0$ 处的水平线代表“完美预测”。
直线合适吗?
- 好迹象:残差随机地散布在零附近——没有剩余规律 → 直线拟合得好。
- 坏迹象:残差呈现曲线或 U 形 → 真实关系是非线性的。
- 还要留意扇形(散布逐渐变大),它表明变异程度不相等。
- 曲线说明线性均值模型可能不合适;扇形说明残差的散布程度可能不恒定,即使均值趋势是线性的。
高估与低估
- 残差为负的地方,模型高估了(预测得太高)。
- 残差为正的地方,模型低估了(预测得太低)。
- 一段同号残差意味着直线在那里存在系统性偏差。
- 符号随机、数值较小 → 模型在正常工作。

符号约定容易让人弄混:残差是观测值 − 预测值。正残差意味着实际值在线上方,所以模型低估了它。而弯曲的残差图是直线模型错误的最清晰证据,即使原散点图看起来“足够接近”。
一套预测为 $300$、实际售出 $330$(单位:千美元)的房子。
- 残差 $= 330 - 300 = +30$——正。
- 点位于线上方;模型低估了这套房子。
- 如果附近许多点都是正残差,直线在那里就偏低了。
残差是 $y - \hat{y}$(观测值 − 预测值):正 = 点在线上方(低估),负 = 点在线下方(高估)。残差图若在 $0$ 附近呈随机散布,则支持线性模型;若呈弯曲的规律,则说明关系是非线性的,直线不合适。
根据数据作答:求残差
- 观测到的 y 值为 18。
- 直线预测值为 14。课程中残差为 30 的是另一个数据点。
An observed response is y=18 and the line predicts 14. Find the residual and explain what its sign says about the prediction.
Residual equals observed minus predicted.
An observed response is 18 and its predicted value is 14. What is the residual?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
18 minus 14 is 4. Other options — 30 (the other point); 32 (the two values added).
Residuals = vertical gaps to the line
Each point's vertical distance from the line is its residual.
A house predicted at 300 sold for 330 (thousands). What is the residual?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Residual = observed − predicted = 330 − 300 = 30.
A positive residual tells you the point is... and the model...
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Observed > predicted → point above line → model underpredicted.
What does a residual plot with an obvious curved (U-shaped) pattern tell you?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
A leftover curve means the true form isn't linear.
A residual plot with points scattered randomly around zero suggests a linear model is appropriate.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Random scatter, no pattern → a line fits well.
A residual is computed as observed minus ___.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Residual = y − y-hat = observed − predicted.
出了什么问题?只有网站团队能看到这些信息。