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

A-Level Mathematics: Linear Regression Models and Prediction | A-Level 数学:线性回归模型与预测

2026-08-30 11:54 · 本文部分内容由AI辅助创作

📚 A-Level Mathematics: Linear Regression Models and Prediction | A-Level 数学:线性回归模型与预测

Linear regression is one of the most powerful and widely used statistical techniques in A-Level Mathematics. It allows us to model the relationship between two variables, estimate the strength of that relationship, and make predictions about future or unseen observations. This article provides a complete guide to linear regression models, from underlying assumptions to parameter estimation and prediction intervals, with all key concepts explained in a bilingual format.

线性回归是 A-Level 数学中最强大且应用最广泛的统计方法之一。它使我们能够对两个变量之间的关系建立模型、估计该关系的强度,并对未来或未观测的数据做出预测。本文提供线性回归模型的完整指南,从基本假设到参数估计与预测区间,所有关键概念均以中英双语对照的形式呈现。


1. The Concept of Regression | 回归的概念

is assumed to be linear, giving us a straight-line model of the form y = a + bx. The term 'regression' was first coined by Sir Francis Galton in the 19th century, who observed that extreme characteristics in parents tended to 'regress' toward the average in their offspring. Today, the term refers more broadly to any statistical modelling of a relationship between variables.

回归分析是一种用于研究因变量(通常记作 y)与一个或多个自变量(通常记作 x)之间关系的统计方法。在最简单的情形下,我们只有一个自变量,并且假设关系是线性的,从而得到形如 y = a + bx 的直线模型。"回归"一词最早由弗朗西斯·高尔顿爵士在 19 世纪提出,他观察到父母身上的极端特征在后代中往往会"回归"到平均水平。如今,该术语更广泛地指对变量之间关系进行统计建模的任何方法。


2. The Linear Model: y = a + bx | 线性模型:y = a + bx

oefficient b is the slope (gradient) of the line, representing the expected change in y for a one-unit increase in x. In a regression context, this line is specifically chosen to minimise the vertical distances between the observed data points and the line itself, using the method of least squares.

对于给定的一组 n 个成对观测值 (x₁, y₁), (x₂, y₂), ..., (xₙ, yₙ),我们尝试拟合一条形如 y = a + bx 的直线。其中 x 是自变量(解释变量),y 是因变量(响应变量)。常数 a 是 y 截距,表示当 x = 0 时 y 的取值。系数 b 是直线的斜率(梯度),表示 x 每增加一个单位,y 的期望变化量。在回归语境下,这条直线是专门通过最小二乘法来选择的,目的是最小化观测数据点到直线本身的垂直距离。


3. The Method of Least Squares | 最小二乘法

he sum of squared vertical deviations between the observed values yᵢ and the fitted values ŷᵢ = a + bxᵢ. The residual for the i-th observation is defined as eᵢ = yᵢ − ŷᵢ. The sum of squared errors (SSE), also called the residual sum of squares, is given by:

最小二乘法通过求解 a 和 b 的值,使观测值 yᵢ 与拟合值 ŷᵢ = a + bxᵢ 之间垂直偏差的平方和最小。第 i 个观测值的残差定义为 eᵢ = yᵢ − ŷᵢ。误差平方和(SSE),也称为残差平方和,其公式为:

SSE = Σ(yᵢ − ŷᵢ)² = Σ(yᵢ − a − bxᵢ)²

By taking partial derivatives of SSE with respect to a and b and setting them equal to zero, we obtain two simultaneous equations known as the normal equations. Solving these yields the least squares estimates, which have the desirable property of being the best linear unbiased estimators (BLUE) under the Gauss-Markov assumptions.

通过将 SSE 分别对 a 和 b 求偏导数并令其等于零,可以得到两个联立方程,称为正规方程。解这些方程即可得到最小二乘估计量,在高斯-马尔可夫假设下,它们具有"最佳线性无偏估计量"(BLUE)的良好性质。


4. Calculating the Slope and Intercept | 计算斜率与截距

The least squares estimates of the slope b and intercept a can be computed using the following formulae. It is essential to memorise these for the A-Level examination, as they are not always provided in the formula booklet:

斜率 b 和截距 a 的最小二乘估计量可使用以下公式计算。对于 A-Level 考试来说务必熟记这些公式,因为公式册中不一定总提供它们:

b = Sxy / Sxx = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)²

a = ȳ − bx̄

Here, x̄ is the mean of the x-values, ȳ is the mean of the y-values, Sxx is the sum of squared deviations of x from its mean, and Sxy is the sum of products of the deviations of x and y from their respective means. An alternative computational form for b is:

其中,x̄ 是 x 值的均值,ȳ 是 y 值的均值,Sxx 是 x 与其均值偏差的平方和,Sxy 是 x 和 y 分别与其均值偏差的乘积之和。b 的另一种计算形式为:

b = [Σxᵢyᵢ − (Σxᵢ)(Σyᵢ)/n] / [Σxᵢ² − (Σxᵢ)²/n]

Notice that the regression line always passes through the point (x̄, ȳ), the centroid of the data. This is a useful property for sketching the fitted line on a scatter diagram.

注意,回归直线总是经过点 (x̄, ȳ),即数据的质心。这一性质在散点图上绘制拟合直线时非常有用。


5. Worked Example: Calculating the Regression Line | 算例:计算回归直线

Consider the following data on the number of hours studied (x) and the exam score (y) for 5 students:

考虑以下 5 名学生的学习小时数(x)和考试成绩(y)数据:

x246810
y5060708595

16 + 36 + 64 + 100 = 220, Σxy = 100 + 240 + 420 + 680 + 950 = 2390. The sample means are x̄ = 30/5 = 6 and ȳ = 360/5 = 72. Thus:

首先计算以下总和:Σx = 30,Σy = 360,Σx² = 4 + 16 + 36 + 64 + 100 = 220,Σxy = 100 + 240 + 420 + 680 + 950 = 2390。样本均值为 x̄ = 30/5 = 6,ȳ = 360/5 = 72。因此:

b = (2390 − (30)(360)/5) / (220 − (30)²/5) = (2390 − 2160) / (220 − 180) = 230/40 = 5.75

a = 72 − (5.75)(6) = 72 − 34.5 = 37.5

The fitted regression line is therefore ŷ h additional hour of study is associated with an expected increase of 5.75 points in the exam score, and a student who studies 0 hours would be expected to score 37.5 points.

因此拟合回归直线为 ŷ = 37.5 + 5.75x。这表明每多学习一小时,考试成绩预期增加 5.75 分;学习 0 小时的学生预期得分为 37.5 分。


6. Interpretation of a and b | a 与 b 的含义解释

e observed range of the data or has a real-world context. If x cannot realistically take the value 0, then a is simply a mathematical constant with no practical interpretation. The slope b, on the other hand, always has a meaningful interpretation: it represents the average change in y associated with a one-unit increase in x. For example, if y is salary in thousands of pounds and x is years of experience, then b represents the expected increase in salary (in thousands) for each additional year of experience.

截距 a 仅在 x = 0 处于数据观测范围内或具有现实意义时才有解释价值。如果 x 实际上不可能取 0,那么 a 只是一个没有实际解释意义的数学常数。相比之下,斜率 b 始终具有明确的解释:它表示 x 每增加一个单位时,y 的平均变化量。例如,如果 y 以千英镑为单位的薪水,x 是工作年限,那么 b 就表示每增加一年工作经验,薪水的预期增长量(以千为单位)。


广告 / Sponsored

7. The Coefficient of Determination r² | 决定系数 r²

Once the regression line is fitted, we need to measure how well it fits the data. This is quantified by the coefficient of determination, r². It is the square of the Pearson product-moment correlation coefficient r, and it represents the proportion of the total variation in y that is explained by the linear relationship with x. The value of r² always lies between 0 and 1 (inclusive). An r² close to 1 indicates that most of the variation in y is explained by the model, while an r² close to 0 suggests that the linear relationship is weak.

拟合出回归直线后,我们需要度量其拟合优度。这一指标由决定系数 r² 来量化。r² 是皮尔逊积矩相关系数 r 的平方,表示 y 的总变异中可由与 x 的线性关系解释的比例。r² 的取值始终在 0 到 1(含)之间。r² 接近 1 表示 y 的大部分变异可由模型解释,而 r² 接近 0 则表明线性关系较弱。

r² = (Sxy / √Sxx · Syy)² = Sxy² / (Sxx · Syy)

where Syy = Σ(yᵢ − ȳ lained variation (SSR) + unexplained variation (SSE). Then r² = SSR / Syy = 1 − SSE / Syy.

其中 Syy = Σ(yᵢ − ȳ)² = Σyᵢ² − (Σyᵢ)²/n。一个有用的分解是:总变异(Syy)= 可解释变异(SSR)+ 不可解释变异(SSE)。于是 r² = SSR / Syy = 1 − SSE / Syy。


8. Prediction Using the Regression Line | 使用回归直线进行预测

n model is prediction. Given a new value of x, denoted x₀, we can estimate the corresponding value of y by substituting into the regression equation: ŷ bx₀. For our worked example, if a student studies for 7 hours, the predicted exam score is ŷ ucial to distinguish between two types of prediction: interpolation (predicting within the observed range of x) and extrapolation (predicting outside the observed range of x).

拟合回归模型的主要用途是预测。给定一个新的 x 值,记作 x₀,我们可以将其代入回归方程来估计对应的 y 值:ŷ₀ = a + bx₀。在我们的算例中,如果一名学生学习 7 小时,预测的考试成绩为 ŷ = 37.5 + 5.75 × 7 = 77.75 分。关键要区分两种预测类型:内插(在 x 的观测范围内预测)和外推(在 x 的观测范围之外预测)。


9. Interpolation vs. Extrapolation | 内插与外推

e data. For instance, in our study-time example, predicting the exam score for x = 1 hour is extrapolation and may be unreliable if the true relationship becomes non-linear for very small study times. Similarly, predicting for x = 20 hours is also extrapolation and may overestimate performance, as there may be diminishing returns.

当 x₀ 位于观测 x 值的范围内时,内插通常被认为是可靠的,前提是线性模型本身适当。外推则因 x₀ 位于观测范围之外而存在风险,因为我们没有证据表明线性关系在数据范围之外仍然成立。例如,在我们的学习时间例子中,预测 x = 1 小时的考试成绩属于外推,如果真实关系在学习时间很短时变为非线性,则预测可能不可靠。同样,预测 x = 20 小时也属于外推,由于可能存在边际递减效应,预测值可能高估实际表现。


10. Residuals and Model Diagnostics | 残差与模型诊断

Residuals are the differences between the observed and fitted values: eᵢ = yᵢ − ŷ inst x) should show no discernible pattern if the linear model is correct. If the residual plot shows a curved pattern, this suggests that a non-linear model may be more suitable. If the residuals fan out or narrow as x increases, this indicates non-constant variance (heteroscedasticity), which violates a key assumption of the model.

残差是观测值与拟合值之间的差:eᵢ = yᵢ − ŷᵢ。分析残差是检验线性模型是否适当的重要步骤。如果线性模型正确,那么以拟合值(或 x)为横轴绘制残差图时,残差点应呈现无规律的随机散布。若残差图呈弯曲状,则提示非线性模型可能更合适。若残差随 x 增大而发散或收窄,则表明方差不恒定(异方差性),这违反了模型的一个关键假设。

For the worked example, the residuals are: for x = 2, ŷ = 37.5 + 5.75 × 2 = 49, e = 50 − 49 = 1; for x = 4, ŷ = 60.5, e = 60 − 60.5 = −0.5; for x = 6, ŷ = 72, e = 70 − 72 = −2; for x = 8, ŷ = 83.5, e = 85 − 83.5 = 1.5; for x = 10, ŷ dual sum of squares is SSE = 1² + (−0.5)² + (−2)² + 1.5² + 0² = 1 + 0.25 + 4 + 2.25 = 7.5.

对于本例,各残差为:x = 2 时,ŷ = 37.5 + 5.75 × 2 = 49,e = 50 − 49 = 1;x = 4 时,ŷ = 60.5,e = 60 − 60.5 = −0.5;x = 6 时,ŷ = 72,e = 70 − 72 = −2;x = 8 时,ŷ = 83.5,e = 85 − 83.5 = 1.5;x = 10 时,ŷ = 95,e = 95 − 95 = 0。残差平方和为 SSE = 1² + (−0.5)² + (−2)² + 1.5² + 0² = 1 + 0.25 + 4 + 2.25 = 7.5。


11. Assumptions of the Linear Regression Model | 线性回归模型的假设

For the standard linear regression model to yield valid inferences and predictions, several assumptions must hold. First, linearity: the relationship between x and y must be approximately linear. Second, independence: the observations must be independent of each other. Third, homoscedasticity: the variance of the residuals must be constant across all values of x. Fourth, normality: the residuals should be approximately normally distributed, particularly for constructing confidence intervals and prediction intervals. In the A-Level syllabus, you are expected to know these assumptions and to interpret residual plots to check them.

标准线性回归模型要产生有效的推断和预测,必须满足若干假设。第一,线性性:x 与 y 之间的关系必须近似为线性。第二,独立性:各观测值必须相互独立。第三,同方差性:残差的方差在所有 x 取值上必须恒定。第四,正态性:残差应近似服从正态分布,特别是在构建置信区间和预测区间时。在 A-Level 考纲中,要求你掌握这些假设,并通过解释残差图来检验它们。


12. Common Pitfalls and Exam Tips | 常见错误与考试技巧

Students often make several common mistakes when tackling regression questions. The most frequent is confusing the regression line of y on x with the regression line of x on y. These are different lines, and the second is NOT obtained by rearranging the first. The regression line of y on x minimises vertical distances, while the regression line of x on y minimises horizontal distances. Another common error is using correlation to imply causation; a high r value does not mean that x causes y. Finally, always round your final answer appropriately but keep intermediate values in your calculator as exact as possible.

学生在做回归类题目时经常犯几个典型错误。最常犯的是混淆 y 对 x 的回归直线与 x 对 y 的回归直线。这两条线是不同的,后者不是简单地对前者进行代数变形得到的。y 对 x 的回归线最小化垂直距离,而 x 对 y 的回归线最小化水平距离。另一个常见错误是用相关关系暗示因果关系;r 值高并不意味着 x 导致了 y。最后,最终答案要适当四舍五入,但中间值在计算器中应尽可能保持精确。

When interpreting a regression coefficient, always mention the units of both variables. For prediction questions, explicitly state whether you are interpolating or extrapolating, and justify your confidence accordingly. Also remember that the regression line always passes through (x̄, ȳ), which can be used as a quick check of your calculated a and b values.

在解释回归系数时,务必同时说明两个变量的单位。对于预测类题目,明确指出你在做内插还是外推,并据此说明你的置信程度。同时记住回归直线总是经过 (x̄, ȳ),这可以作为检验你所求 a 和 b 值是否正确的一个快速手段。


Published by TutorHao | Mathematics Revision Series | aleveler.com

广告 / Sponsored
【现货】剑桥国际高中教材 Cambridge IGCSE & O Level Additional Mathemati…
数学 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥198.0

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

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