📚 Linear Regression | 线性回归
In A-Level Edexcel Mathematics, linear regression is a core statistical technique used to model the relationship between two quantitative variables by fitting a straight line to observed data. This article covers scatter diagrams, the least squares regression line y = a + bx, calculation of a and b, interpretation, predictions, limitations and the product moment correlation coefficient.
在爱德思 A-Level 数学中,线性回归是核心统计方法,用于通过拟合直线来建模两个数值变量之间的关系。本文涵盖散点图、最小二乘回归直线 y = a + bx、a 和 b 的计算、解释、预测、局限性以及积矩相关系数。
1. What is Linear Regression? | 什么是线性回归?
Linear regression describes the linear association between an explanatory variable x and a response variable y. It assumes that y changes approximately linearly as x changes, so a straight line can summarise the trend in the data.
线性回归描述解释变量 x 与响应变量 y 之间的线性关系。它假设 y 随 x 的变化近似呈线性,因此可以用一条直线来概括数据的趋势。
In Edexcel questions, x is often called the independent variable and y the dependent variable. The fitted line can be used to estimate y for a given x, provided the relationship is sufficiently strong and the value is within a sensible range.
在爱德思考试题中,x 通常称为自变量,y 称为因变量。只要关系足够强且取值在合理范围内,拟合直线就可用于给定 x 估计 y。
2. Scatter Diagrams and Correlation | 散点图与相关性
A scatter diagram displays paired data (x, y) as points on a graph. The pattern of points indicates the direction, form and strength of the relationship.
散点图将成对数据 (x, y) 以点的形式显示在图上。点的分布模式可以表明关系的方向、形式和强度。
Positive correlation means that as x increases, y tends to increase. Negative correlation means that as x increases, y tends to decrease. If there is no obvious pattern, the variables may be uncorrelated.
正相关意味着 x 增大时 y 趋于增大;负相关意味着 x 增大时 y 趋于减小。如果没有明显模式,变量可能不相关。
Linear regression is appropriate only when the scatter diagram suggests a straight-line trend. A curved pattern indicates a non-linear relationship and should not be modelled with a simple linear equation.
只有散点图显示直线趋势时,线性回归才适用。曲线模式表明存在非线性关系,不应使用简单线性方程建模。
3. The Least Squares Regression Line | 最小二乘回归直线
The regression line of y on x is written as:
y 对 x 的回归直线写为:
y = a + bx
Here b is the gradient and a is the y-intercept. The regression line is chosen to minimise the sum of the squared vertical residuals, where a residual is the difference between an observed y-value and the value predicted by the line.
其中 b 为斜率,a 为 y 轴截距。回归直线的选取原则是使竖直残差平方和最小,其中残差是观测 y 值与直线预测值之差。
The least squares regression line always passes through the mean point (x̄, ȳ). This is a useful check: if your calculated line does not pass through the mean point exactly, there is likely a rounding or calculation error.
最小二乘回归直线总是通过均值点 (x̄, ȳ)。这是一个有用的检验方法:如果计算出的直线没有精确通过均值点,很可能存在舍入或计算错误。
4. Calculating the Regression Coefficient b | 回归系数 b 的计算
The gradient b is calculated using the formula:
斜率 b 用以下公式计算:
b = Sxy / Sxx
The two sums of squares and products are defined as follows:
两个平方和与乘积和定义如下:
Sxx = Σx² − (Σx)²/n
Sxy = Σxy − (Σx)(Σy)/n
Sxx measures the total variation in the x-values, while Sxy measures the joint variation of x and y. The ratio b = Sxy / Sxx therefore gives the estimated change in y per unit change in x.
Sxx 度量 x 值的总变异,而 Sxy 度量 x 与 y 的联合变异。因此比值 b = Sxy / Sxx 给出 x 每变化一个单位时 y 的估计变化量。
Always calculate Sxx and Sxy from the raw data using the formula above. Do not round intermediate values; keep full calculator accuracy throughout.
始终使用上述公式从原始数据计算 Sxx 和 Sxy。不要对中间值四舍五入,应全程保留计算器的完整精度。
5. Calculating the Intercept a | 截距 a 的计算
Once b has been calculated, the intercept a is found from the means of x and y:
一旦计算出 b,截距 a 可由 x 和 y 的均值求出:
a = ȳ − b x̄
The mean of x is x̄ = Σx/n and the mean of y is ȳ = Σy/n. Use the unrounded value of b in this calculation to avoid introducing rounding errors.
x 的均值为 x̄ = Σx/n,y 的均值为 ȳ = Σy/n。在此计算中使用未四舍五入的 b 值,以避免引入舍入误差。
Only round your final values of a and b to the accuracy requested in the question, usually three significant figures unless otherwise stated.
只将 a 和 b 的最终值四舍五入到题目要求的精度,除非另有说明,通常为三位有效数字。
6. Interpreting the Regression Equation | 解释回归方程
The gradient b represents the estimated change in y for each 1-unit increase in x. For example, if b = 3.2, then y is expected to increase by 3.2 units for every extra unit of x.
斜率 b 表示 x 每增加 1 个单位时 y 的估计变化量。例如,如果 b = 3.2,那么 x 每增加 1 个单位,y 预计增加 3.2 个单位。
The intercept a is the predicted value of y when x = 0. In many real-life contexts, x = 0 lies outside the observed data range, so a may not have a meaningful interpretation.
截距 a 是当 x = 0 时 y 的预测值。在许多实际情境中,x = 0 位于观测数据范围之外,因此 a 可能没有实际解释意义。
When answering an exam interpretation question, always include the context and units, for example: ‘For each additional hour of revision, the predicted test score increases by 1.5 marks.’
回答考试中的解释题时,务必结合情境和单位,例如:“每多复习一小时,预测测试成绩增加 1.5 分。”
7. Making Predictions: Interpolation and Extrapolation | 进行预测:内插与外推
Interpolation means using the regression line to predict y for an x-value within the range of the observed data. This is generally considered reliable if the correlation is strong.
内插是指利用回归直线对观测数据范围内的 x 值预测 y。如果相关性强,这通常被认为是可靠的。
Extrapolation means predicting y for an x-value outside the observed data range. This is often unreliable because the linear trend may not continue beyond the data.
外推是指对观测数据范围之外的 x 值预测 y。这通常不可靠,因为线性趋势可能不会延续到数据范围之外。
In Edexcel exams, questions often ask whether an estimate is reliable. You should support your answer by mentioning interpolation, extrapolation, the correlation strength or the data range.
在爱德思考试中,题目经常问某个估计值是否可靠。你应通过提及内插、外推、相关强度或数据范围来支持你的答案。
8. Limitations and Reliability | 局限性与可靠性
A strong linear correlation does not imply causation. Two variables may be strongly associated because of a third variable, or the relationship may be coincidental.
强线性相关并不意味着因果关系。两个变量可能因为第三个变量而高度相关,或者这种关系可能是巧合。
Outliers can strongly influence the position of the regression line. A single extreme point can pull the line towards it, so you should identify and discuss outliers when appropriate.
异常值会严重影响回归直线的位置。一个极端点就可能将直线拉向自身,因此你应在合适时识别并讨论异常值。
If the linear model is appropriate, residual plots should show no obvious pattern. Curved patterns or increasing spread in residuals suggest that a linear regression may not be suitable.
如果线性模型合适,残差图不应呈现明显模式。残差呈曲线模式或离散程度增大,则表明线性回归可能不适用。
9. The Product Moment Correlation Coefficient (PMCC) | 积矩相关系数
The product moment correlation coefficient, usually denoted by r, measures the strength and direction of linear correlation. Its formula is:
积矩相关系数通常记为 r,用于度量线性相关的强度和方向。其公式为:
r = Sxy / √(Sxx × Syy)
Here Syy is defined as:
其中 Syy 定义为:
Syy = Σy² − (Σy)²/n
The value of r always satisfies −1 ≤ r ≤ 1. Values close to 1 or −1 indicate strong positive or strong negative linear correlation; values close to 0 indicate weak or no linear correlation.
r 的值始终满足 −1 ≤ r ≤ 1。接近 1 或 −1 表示强正相关或强负相关;接近 0 表示弱相关或无线性相关。
In Edexcel papers, you may be required to calculate r and interpret it in context. Remember that r only measures linear correlation, so a value near 0 does not rule out a strong non-linear relationship.
在爱德思试卷中,你可能需要计算 r 并结合语境进行解释。请记住,r 只度量线性相关,因此接近 0 并不排除存在强非线性关系。
10. Worked Example | 例题解析
The following table shows five paired observations of x and y.
下表显示 x 和 y 的五组配对观测值。
| x | y | x² | y² | xy |
|---|---|---|---|---|
| 2 | 4 | 4 | 16 | 8 |
| 3 | 5 | 9 | 25 | 15 |
| 5 | 8 | 25 | 64 | 40 |
| 7 | 11 | 49 | 121 | 77 |
| 9 | 13 | 81 | 169 | 117 |
| Σx = 26 | Σy = 41 | Σx² = 168 | Σy² = 395 | Σxy = 257 |
With n = 5, calculate the key sums of squares:
由于 n = 5,计算关键的平方和与乘积和:
Sxx = 168 − 26²/5 = 32.8
Sxy = 257 − (26 × 41)/5 = 43.8
Syy = 395 − 41²/5 = 58.8
The gradient is b = Sxy / Sxx = 43.8 / 32.8 ≈ 1.335. The means are x̄ = 26/5 = 5.2 and ȳ = 41/5 = 8.2, so the intercept is:
斜率为 b = Sxy / Sxx = 43.8 / 32.8 ≈ 1.335。均值为 x̄ = 26/5 = 5.2 和 ȳ = 41/5 = 8.2,因此截距为
Published by TutorHao | A-Level Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply