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

Least squares linear regression | 最小二乘线性回归

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

📚 Least squares linear regression | 最小二乘线性回归

topic of least squares linear regression forms a vital part of the statistics component. It allows us to model the linear relationship between two variables using a straight line of best fit. The method minimises the sum of the squared vertical distances from the data points to the line, producing the 'least squares' used for prediction. Understanding the underlying formulas, the meaning of the coefficients, and the limitations of the model is essential for success in exams and further study.

在Edexcel A-Level数学中,最小二乘线性回归是统计部分的重要内容。它使我们能够用一条最佳拟合直线来建模两个变量之间的线性关系。该方法通过最小化数据点到直线的垂直距离的平方和,得到“最小二乘”回归直线 y = a + bx,可用于预测。理解其基本公式、系数的含义以及模型的局限性,对于考试和后续学习至关重要。


1. Introduction to Linear Regression | 线性回归简介

the points show a roughly linear pattern, we can fit a straight line. The simplest form is simple linear regression: y = a + bx, where a is the intercept and b is the slope. The least squares method gives us the best estimates for a and b based on the available data.

回归分析研究响应变量(y)与解释变量(x)之间的关联。散点图是第一步;如果数据点大致呈线性,我们就可以拟合一条直线。最简单的形式就是简单线性回归:y = a + bx,其中 a 为截距,b 为斜率。最小二乘法基于现有数据给出 a 和 b 的最佳估计。


2. The Least Squares Principle | 最小二乘法原理

The best-fit line is chosen so that the sum of the squares of the residuals is a minimum. This principle penalises large deviations more heavily than small ones, and ensures that the line is uniquely determined. By minimising Σ (yᵢ – a – bxᵢ)², we obtain the line that is, on average, closest to all data points in the vertical direction.

最佳拟合直线被选定为使残差平方和最小的那条直线。这一原则对较大的偏离施加更重的惩罚,并确保直线被唯一确定。通过最小化 Σ (yᵢ – a – bxᵢ)²,我们得到的直线在垂直方向上平均最接近所有数据点。


广告 / Sponsored

3. Defining Residuals | 定义残差

A residual for the i-th data point is eᵢ = yᵢ – ŷᵢ, where ŷ e sum of the residuals is always zero for a least squares line fitted with an intercept term, i.e. Σ eᵢ = 0.

第 i 个数据点的残差定义为 eᵢ = yᵢ – ŷᵢ,其中 ŷᵢ = a + bxᵢ 为拟合值。正残差表示该点位于回归直线上方,负残差表示在下方。对于包含截距项的最小二乘直线,残差总和始终为零,即 Σ eᵢ = 0。

eᵢ = yᵢ – (a + bxᵢ)


4. Deriving the Normal Equations | 推导正规方程

To minimise SSE = Σ (yᵢ – a – bxᵢ)², we take partial derivatives with respect to a and b and set them to zero:

为了最小化 SSE = Σ (yᵢ – a – bxᵢ)²,我们对 a 和 b 求偏导并令其为零:

∂SSE/∂a = –2 Σ (yᵢ – a – bxᵢ) = 0 → Σ yᵢ = n a + b Σ xᵢ

∂SSE/∂b = –2 Σ xᵢ(yᵢ – a – bxᵢ) = 0 → Σ xᵢyᵢ = a Σ xᵢ + b Σ xᵢ²

These two equations are called the normal equations. Solving them simultaneously yields the least squares estimates for a and b.

这两个方程称为正规方程。同时求解它们即可得到 a 和 b 的最小二乘估计。


5. Formulas for Regression Coefficients | 回归系数公式

The solution to the normal equations gives the slope b and intercept a in terms of summary statistics. The most common forms are:

正规方程的解用汇总统计量给出了斜率 b 和截距 a。最常见的形式为:

b = Sxy / Sxx

a = ȳ – b x̄

where x̄ = Σ xᵢ / n, ȳ = Σ yᵢ / n, Sxy = Σ (xᵢ – x̄)(yᵢ – ȳ) = Σ xᵢyᵢ – (Σ xᵢ)(Σ yᵢ)/n, and Sxx = Σ (xᵢ – x̄)² = Σ xᵢ² – (Σ xᵢ)²/n.

其中 x̄ = Σ xᵢ / n,ȳ = Σ yᵢ / n,Sxy = Σ (xᵢ – x̄)(yᵢ – ȳ) = Σ xᵢyᵢ – (Σ xᵢ)(Σ yᵢ)/n,Sxx = Σ (xᵢ – x̄)² = Σ xᵢ² – (Σ xᵢ)²/n。

These formulas are provided in the Edexcel formulae booklet, but you must know how to

Published by TutorHao | A-Level Mathematics Revision Series | aleveler.com

广告 / Sponsored
英文原版 Collins International Primary Computing 柯林斯国际小学计算机科学学生…
计算机 备考教辅 · 正版现货 · 与本文同科同级别
查看详情 / View on Taobao

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

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