# 高斯-牛顿算法

高斯-牛顿算法是一种求解非线性最小二乘问题的迭代方法，即用于最小化形如 \( \tfrac{1}{2}\|f(x)\|^2 \) 的目标函数，其中 \( f: \mathbb{R}^n \to \mathbb{R}^m \) 是残差向量，通常 \( m \ge n \)。每次迭代在当前点附近对残差做线性化，并求解由此得到的线性最小二乘问题以确定步长，从而避免计算任何二阶导数。<sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup> 它是非线性最小二乘最著名的方法之一<sup>[2](https://www.sciencedirect.com/science/article/pii/S009630030500010X)</sup>，也是莱文贝格-马夸特等广泛使用的求解器的基础。<sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 求解的问题 | 对 \( f: \mathbb{R}^n \to \mathbb{R}^m \) 最小化 \( \phi(x) = \tfrac{1}{2}\|f(x)\|^2 \)，通常 \( m > n \)<sup>[3](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-04-10.html)</sup> |
| 步长计算 | 线性化 \( f(x+\Delta x) \approx f(x) + J(x)\Delta x \) 并求解 \( \min_{\Delta x} \tfrac{1}{2}\|J(x)\Delta x + f(x)\|^2 \)<sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup> |
| 所需导数 | 仅需一阶导数；不计算 Hessian 矩阵的任何二阶项<sup>[4](https://epubs.siam.org/doi/10.1137/050624935)</sup> |
| 特殊情况 \( m = n \) | 更新式退化为求解 \( n \) 个变量、\( n \) 个非线性方程的牛顿算法<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup> |
| 收敛速度 | 当解处 \( f(x^*) = 0 \) 时为二次收敛；否则通常为线性收敛，并随残差缩小而加速<sup>[3](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-04-10.html)</sup><sup> • </sup><sup>[6](https://raw.org/book/optimization/gauss-newton-method/)</sup> |
| 已知失效模式 | 基本形式可能发散；若雅可比矩阵的列变为线性相关，则算法停止<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup> |
| 标准修正 | 莱文贝格-马夸特方法加入阻尼（信赖域）项以控制步长并处理秩亏<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup><sup> • </sup><sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup> |

## 迭代过程

非线性最小二乘目标 \( \phi(x) = \tfrac{1}{2}\|f(x)\|^2 \) 的梯度为 \( \nabla \phi(x) = J(x)^\top f(x) \)，其中 \( J(x) \) 是残差的 \( m \times n \) 雅可比矩阵。<sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup><sup> • </sup><sup>[3](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-04-10.html)</sup> 在每次迭代中，算法构造仿射模型

\[ \hat f(x;\, x^{(k)}) = f(x^{(k)}) + Df(x^{(k)})(x - x^{(k)}) \]

并将下一个迭代点设为 \( \|\hat f(x; x^{(k)})\|^2 \) 的最小化点，这是一个线性最小二乘问题。<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup> 等价地，步长求解正规方程 \( J^\top J \, \Delta x = -J^\top f \)，而在实践中，对雅可比矩阵做 QR 分解比显式构造 \( J^\top J \) 更为妥当。<sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup><sup> • </sup><sup>[7](https://heath.cs.illinois.edu/scicomp/notes/cs450_chapt06.pdf)</sup>

由于 \( x^{(k+1)} \) 使模型最小化，模型残差 \( \|\hat f(x^{(k+1)}; x^{(k)})\| \) 永远不会超过 \( \|f(x^{(k)})\| \)。这与真实残差下降并不是一回事：线性化仅在 \( x^{(k)} \) 附近可靠，因此当步长较大时，\( x^{(k+1)} \) 处的真实残差可能比 \( x^{(k)} \) 处更大。<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup>

## 与牛顿法的关系

对于最小二乘目标，精确的 Hessian 矩阵等于 \( J^\top J \) 加上一个涉及残差二阶导数的二阶项。高斯-牛顿法舍弃该二阶项，只保留 \( J^\top J \)，这正是它不需要二阶导数的原因。<sup>[8](https://epubs.siam.org/doi/10.1137/0715063)</sup><sup> • </sup><sup>[9](https://epubs.siam.org/doi/10.1137/1022001)</sup> 随着残差减小，该近似不断改善；当数据被完美拟合时，该近似是精确的。<sup>[10](https://papers.neurips.cc/paper_files/paper/2019/file/46a558d97954d0692411c861cf78ef79-Paper.pdf)</sup>

当 \( m = n \) 时，雅可比矩阵为方阵，更新式简化为 \( x^{(k+1)} = x^{(k)} - (Df(x^{(k)}))^{-1} f(x^{(k)}) \)，这恰好是求解由 \( n \) 个非线性方程组成的方程组的牛顿算法。<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup>

## 收敛性

收敛性分析假设雅可比矩阵以常数 \( L \) 满足利普希茨连续，且解处 \( J \) 的最小奇异值 \( \sigma_{\min}(J_*) \) 为正。在这些条件下，误差满足如下形式的界

\[ \|e^{k+1}\| \le L \left( \frac{\|f_*\|}{(\sigma_{\min}(J_*) - L\|e^k\|)^2} + \frac{\|e^k\|/2}{\sigma_{\min}(J_*) - L\|e^k\|} \right) \|e^k\|, \]

因此若 \( f(x^*) = 0 \)，该方法恢复牛顿法的二次收敛性。保证下降的一个充分条件是 \( \|e^k\| \le \tfrac{2\sigma_{\min}(J_*)}{5L}\left(1 - \tfrac{L\|f_*\|}{\sigma_{\min}(J_*)^2}\right) \)。<sup>[3](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-04-10.html)</sup> 更精细的分析在导数满足弱利普希茨条件下，给出了收敛球的半径以及解在其中唯一的球的半径的精确估计。<sup>[2](https://www.sciencedirect.com/science/article/pii/S009630030500010X)</sup>

远离解时，该方法通常仅表现为 Q-线性收敛，并随着拟合改善而加速，趋近于接近二次的牛顿收敛速度。<sup>[6](https://raw.org/book/optimization/gauss-newton-method/)</sup> 收敛性还依赖于初始猜测：只要起点离最优解足够近，方法就会快速收敛。<sup>[11](https://r-resources.massey.ac.nz/161251/Lectures/Lecture39.html)</sup>

## 缺点与阻尼变体

基本算法有两个相关的弱点。<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup> 第一，它可能发散，产生残差范数增大的迭代点，因为线性模型被全局信任，而非仅在当前点附近信任。第二，它假设 \( Df(x^{(k)}) \) 的列线性无关；在某些应用中这一条件从不成立，在另一些应用中则可能在某个迭代点失效，此时下一个迭代点无定义。

莱文贝格-马夸特算法由肯尼斯·莱文贝格（Kenneth Levenberg）和唐纳德·马夸特（Donald Marquardt）首次提出，通过在步长子问题中加入阻尼项 \( \lambda \|D(x)\Delta x\|^2 \) 来解决这两个问题，该项限制步长并对秩亏的雅可比矩阵起正则化作用；它本身有时也被称为高斯-牛顿算法，因为它是后者的自然推广。<sup>[5](https://stanford.edu/~boyd/vmls/vmls.pdf)</sup> 在信赖域实现中，阻尼参数与信赖域半径呈反向关系，半径根据线性模型对目标实际下降的预测好坏而增大或缩小。<sup>[1](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)</sup> 其他修正方法在必要时显式包含或近似被忽略的二阶项，以改进 Hessian 近似。<sup>[8](https://epubs.siam.org/doi/10.1137/0715063)</sup> 对于大残差问题，被省略的项不可忽略，为此人们发展了隐式或显式考虑 Hessian 矩阵第二项的方法。<sup>[9](https://epubs.siam.org/doi/10.1137/1022001)</sup>

各种变体将该方法推广到其他情形：近似或不精确高斯-牛顿方法仅粗略地求解内层线性最小二乘，或使用带扰动的线性化，并已为数据同化应用建立了收敛条件和收敛速度<sup>[4](https://epubs.siam.org/doi/10.1137/050624935)</sup>；近端扩展处理带惩罚的最小二乘<sup>[12](https://arxiv.org/abs/1103.0414)</sup>；无导数版本则在信赖域框架内仅利用函数值构造模型。<sup>[13](https://arxiv.org/abs/1710.11005)</sup>

## 应用与软件

非线性最小二乘主要源于模型拟合，包括形如 \( f(x, y) = \Phi(y)x - b \) 的可分离问题以及具有非线性损失函数的线性模型。<sup>[3](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-04-10.html)</sup> 高斯-牛顿算法尤其适合大气与海洋预报中极大规模变分数据同化问题，在这些问题中精确方法运行成本过高，无法业务化运行，因而使用近似方法以满足实时约束。<sup>[4](https://epubs.siam.org/doi/10.1137/050624935)</sup> 在计算机视觉中，光束法平差——即联合优化三维点位置与相机参数以最小化重投影误差——被表述为非线性最小二乘问题，并用高斯-牛顿类方法及专门的舒尔补线性求解器求解。<sup>[14](https://ceres-solver.readthedocs.io/latest/nnls_tutorial.html)</sup>

统计与数值软件直接或通过其阻尼变体实现该方法：R 的 `nls()` 过程使用高斯-牛顿算法<sup>[11](https://r-resources.massey.ac.nz/161251/Lectures/Lecture39.html)</sup>，SciPy 的 `least_squares` 则使用由 `scipy.sparse.linalg.lsmr` 计算的近似高斯-牛顿解，作为其面向大规模稀疏问题的信赖域反射法中子空间的一部分。<sup>[15](https://docs.scipy.org/doc/scipy-1.13.0/reference/generated/scipy.optimize.least_squares.html)</sup>

## 历史背景

该算法以卡尔·弗里德里希·高斯（Carl Friedrich Gauss）命名，并因其与牛顿法的联系而得名。最小二乘原理本身最早作为附录《论最小二乘方法》（"Sur la Méthode des moindres quarrés"）发表在勒让德（Legendre）的《确定彗星轨道的新方法》（*Nouvelles méthodes pour la détermination des orbites des comètes*，巴黎，1805年）中；高斯在其《天体运动论》（*Theoria Motus Corporum Coelestium*，1809年）中声明自1795年起便已使用该原理。<sup>[16](https://en.wikisource.org/wiki/A_Source_Book_in_Mathematics/Legendre_on_Least_Squares)</sup> 1801年10月，高斯将其轨道确定思想应用于失踪的行星谷神星（Ceres），利用皮亚齐（Piazzi）的观测预测该天体将重新出现的位置，而它果然在所指方向被找到。<sup>[17](https://mathshistory.st-andrews.ac.uk/Extras/Gauss_preface/)</sup> 19世纪期间，最小二乘成为天文学中占主导地位的数据归算技术，出现在肖弗内（Chauvenet）的《球面天文学与实用天文学》（*Spherical and Practical Astronomy*，1863年）和纽科姆（Newcomb）的《球面天文学纲要》（*Compendium of Spherical Astronomy*，1906年）等标准论著中。<sup>[18](https://www.sciencedirect.com/science/article/abs/pii/S1387647301001361)</sup>

## References

1. [Solving Non-linear Least Squares, Ceres Solver documentation](https://ceres-solver.readthedocs.io/latest/nnls_solving.html)
2. [Convergence of Gauss–Newton's method and uniqueness of the solution, Applied Mathematics and Computation 170 (2005)](https://www.sciencedirect.com/science/article/pii/S009630030500010X)
3. [CS 4220: Gauss-Newton and nonlinear least squares, Cornell University](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-04-10.html)
4. [S. Gratton, A. S. Lawless, N. K. Nichols. Approximate Gauss–Newton Methods for Nonlinear Least Squares Problems, SIAM Journal on Optimization](https://epubs.siam.org/doi/10.1137/050624935)
5. [Vandenberghe, Boyd. VMLS, Chapter 18: Nonlinear least squares](https://stanford.edu/~boyd/vmls/vmls.pdf)
6. [Introduction to the Gauss-Newton Method, RAW](https://raw.org/book/optimization/gauss-newton-method/)
7. [CS 450 Numerical Analysis, Chapter 6 notes, University of Illinois](https://heath.cs.illinois.edu/scicomp/notes/cs450_chapt06.pdf)
8. [P. E. Gill, W. Murray. Algorithms for the Solution of the Nonlinear Least-Squares Problem, SIAM Journal on Numerical Analysis 15 (1978)](https://epubs.siam.org/doi/10.1137/0715063)
9. [Some Recent Approaches to Solving Large Residual Nonlinear Least Squares Problems, SIAM Review](https://epubs.siam.org/doi/10.1137/1022001)
10. [The generalized Gauss-Newton matrix, NeurIPS 2019](https://papers.neurips.cc/paper_files/paper/2019/file/46a558d97954d0692411c861cf78ef79-Paper.pdf)
11. [Lecture 39: Nonlinear least squares, Massey University](https://r-resources.massey.ac.nz/161251/Lectures/Lecture39.html)
12. [Convergence analysis of a proximal Gauss-Newton method, arXiv](https://arxiv.org/abs/1103.0414)
13. [DFO-GN: A Derivative-Free Gauss-Newton Method, arXiv](https://arxiv.org/abs/1710.11005)
14. [Non-linear Least Squares tutorial, Ceres Solver documentation](https://ceres-solver.readthedocs.io/latest/nnls_tutorial.html)
15. [scipy.optimize.least_squares, SciPy v1.13.0 Manual](https://docs.scipy.org/doc/scipy-1.13.0/reference/generated/scipy.optimize.least_squares.html)
16. [Legendre on Least Squares, A Source Book in Mathematics, Wikisource](https://en.wikisource.org/wiki/A_Source_Book_in_Mathematics/Legendre_on_Least_Squares)
17. [Gauss preface, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Extras/Gauss_preface/)
18. [Astronomical data reduction with total least squares, ScienceDirect](https://www.sciencedirect.com/science/article/abs/pii/S1387647301001361)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Numerical linear algebra › Least squares and overdetermined systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gauss-newton-algorithm

English original: https://www.edgepedia.org/gauss-newton-algorithm
