# 迭代重加权最小二乘

迭代重加权最小二乘（iteratively reweighted least squares，IRLS）是一种迭代估计方法，它求解一系列加权最小二乘问题，在每次迭代时更新权重，从而计算出普通的一次最小二乘拟合无法给出的估计量。在稳健回归中，它是计算 M 估计量（使稳健损失函数最小化的估计量）的标准做法；同时，它也是广义线性模型以及若干其他估计准则的极大似然拟合背后的算法。<sup>[1](https://apps.dtic.mil/sti/tr/pdf/ADA114534.pdf)</sup><sup> • </sup><sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup> 除指数族广义线性模型之外，同样的迭代也推广到其他分布、非线性参数化、相依观测，以及极大似然之外的估计准则，包括各种抗差替代方案。<sup>[3](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1984.tb01288.x)</sup> 事实上，每一轮都以重新计算的工作权重来迭代求解加权最小二乘，正是标准软件拟合广义线性模型的方式。<sup>[4](https://myweb.uiowa.edu/pbreheny/uk/teaching/760-s13/notes/2-19.pdf)</sup>

| 关键事实 | 细节 |
|---|---|
| 核心更新 | 样本 \( i \) 的权重为 \( w_i^{(t+1)} = \rho'(r_i^{(t)}) / r_i^{(t)} \)，其中 \( \rho \) 为目标函数，\( r_i^{(t)} \) 为当前残差<sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup> |
| 收敛条件 | 对稳健 M 估计量，要求 \( h(\sqrt{x}) \) 处处可微且为凹函数；或者要求权重函数在 \( x > 0 \) 时非增<sup>[5](https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/e7555537-89f3-466f-9875-fcd4b9d8d035/content)</sup><sup> • </sup><sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup> |
| 标准调节常数 | \( c_H = 1.345 \)（Huber）与 \( c_T = 4.685 \)（Tukey 双权）在正态模型下给出 95% 的效率<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup> |
| 稳健性 | 加权最小二乘的崩溃点接近于零；在设计点移动的回归中，具有非减 ψ 的 M 估计量同样崩溃点很低，而崩溃点接近 0.5 需要高崩溃点回归方法，如 S 估计量或最小截尾平方<sup>[7](http://www2.peq.coppe.ufrj.br/Pessoal/Professores/Arge/COQ897/DiegoMenezes_etal_2021.pdf)</sup><sup> • </sup><sup>[18](https://arxiv.org/pdf/1405.5040)</sup> |
| 典型迭代次数 | 在大地测量应用中为 5 次；用现代变体做抗离群估计时为 5 到 10 次，而竞争方法至少需要 30 次<sup>[8](https://www.scielo.br/j/bcg/a/TKcjvhcZ5H8gGThh4Rs9MBp/?lang=en)</sup><sup> • </sup><sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup> |
| 与 GLM 的联系 | 在 R 的 `glm` 等软件中，IRLS 等价于使用典范联系函数时的 Fisher 得分法<sup>[9](https://jmniehaus.github.io/irls.html)</sup> |

## 工作原理

IRLS 利用的是这样一个事实：许多估计准则都可以写成残差平方的加权和。对于准则 \( \rho \)，在第 \( t+1 \) 次迭代时赋予样本 \( i \) 的权重由当前残差 \( r_i^{(t)} \) 计算：\( w_i^{(t+1)} = \rho'(r_i^{(t)}) / r_i^{(t)} \)。<sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup> 由于在稳健的 \( \rho \) 下大残差获得小权重，随后的每一次加权最小二乘拟合都会压低当前拟合解释得较差的那些观测的权重。<sup>[10](https://people.mines.edu/mwakin/wp-content/uploads/sites/262/2024/06/rwl1-july2008.pdf)</sup> 对于 \( \ell_p \) 回归，迭代求解 \( x^{(t+1)} \leftarrow (A^{\top} \cdot R^{(t)} \cdot A)^{-1} A^{\top} \cdot R^{(t)} \cdot b \)，其中 \( R^{(t)} = \mathrm{diag}(|A \cdot x^{(t)} - b|^{p-2}) \)；当 \( p \in (1, \infty) \) 时，该映射的唯一不动点就是 \( \ell_p \) 准则的唯一极小点。<sup>[11](https://papers.nips.cc/paper_files/paper/2019/file/46c7cb50b373877fb2f8d5c4517bb969-Paper.pdf)</sup>

收敛性已在代价函数满足一定条件的情形下得到刻画。要使 IRLS 能极小化常见的稳健 M 估计量，包括 Huber、柯西、布莱克-齐瑟曼和污染高斯代价，关键条件是 \( h(\sqrt{x}) \) 处处可微且为凹函数；该条件成立时，目标函数在每一步都下降，从而收敛。<sup>[5](https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/e7555537-89f3-466f-9875-fcd4b9d8d035/content)</sup> 在 M 估计的表述下，马罗纳及其合作者证明了：若权重函数 \( w(x) \) 在 \( x > 0 \) 时非增，则算法收敛。<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup>

## 操作步骤

实际使用时，按下面的循环执行：<sup>[12](http://saedsayad.com/docs/RobustRegression.pdf)</sup>

1. 选取初始系数估计 \( b^{(0)} \)，通常取普通最小二乘估计。
2. 计算残差，并由残差按所选权重函数算出权重。
3. 求解加权最小二乘问题，得到新的估计 \( \hat{\beta}_{k+1} = (X^{\top} \cdot W_k \cdot X)^{-1} X^{\top} \cdot W_k \cdot y \)。<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup>
4. 重复第 2、3 步，直到系数估计收敛；典型的停止准则是 \( \max_i |r_{i,k} - r_{i,k+1}| < \epsilon \)，其中 \( \epsilon \) 可取固定值，也可与残差尺度挂钩。<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup>

在 M 估计中，尺度估计是循环的一部分：权重在标准化残差 \( r_i(\beta) / \hat{\sigma} \) 处取值，而需要一个尺度估计 \( \hat{\sigma} \) 来保证 \( \hat{\beta} \) 具有尺度等变性。常见的选择是 \( \sigma = \mathrm{MAD} / 0.6745 \)，其中 MAD 是残差绝对值的中位数。<sup>[12](http://saedsayad.com/docs/RobustRegression.pdf)</sup><sup> • </sup><sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup> 对于广义线性模型，同样的迭代通过重新计算工作响应和工作权重得到极大似然估计；在 R 中，`glm(y ~ x, family = binomial)` 调用 `glm.fit`，后者调用 C 代码，再由 FORTRAN 代码执行 IRLS。<sup>[4](https://myweb.uiowa.edu/pbreheny/uk/teaching/760-s13/notes/2-19.pdf)</sup>

## 起源

该方法的标准参考文献是 保罗·W·霍兰德与罗伊·E·韦尔施的论文《使用迭代重加权最小二乘的稳健回归》（Robust regression using iteratively reweighted least-squares），1977 年发表于《统计通讯：理论与方法》（Communications in Statistics, Theory and Methods）第 6 卷第 9 期第 813 至 827 页，研究是在美国国家科学基金会资助下、于美国国家经济研究局计算机研究中心用软件完成的。<sup>[13](https://doi.org/10.1080/03610927708827533)</sup> 《皇家统计学会杂志 B 辑》上的一篇论文将该文作为该方法的参考文献，并把这一迭代推广到一般的极大似然估计，以及稳健与抗差替代方案。<sup>[3](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1984.tb01288.x)</sup> IRLS 算法曾被多次独立发现，已被研究了五十余年，其基本思想也被称为 Weiszfeld 技巧。<sup>[11](https://papers.nips.cc/paper_files/paper/2019/file/46c7cb50b373877fb2f8d5c4517bb969-Paper.pdf)</sup><sup> • </sup><sup>[5](https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/e7555537-89f3-466f-9875-fcd4b9d8d035/content)</sup>

## 变体

\( \rho \) 的选择决定了权重，权重由其导数在当前残差处取值并按 \( \rho'(r)/r \) 计算。<sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup><sup> • </sup><sup>[10](https://people.mines.edu/mwakin/wp-content/uploads/sites/262/2024/06/rwl1-july2008.pdf)</sup> Huber 损失为：当 \( |x| \le c \) 时 \( \rho_H = \tfrac{1}{2} x^2 \)，当 \( |x| > c \) 时 \( c(|x| - c/2) \)，于是当 \( |x| \le c \) 时 \( \psi_H(x) = x \)，否则 \( \psi_H(x) = \mathrm{sign}(x)\,c \)。<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup> 各权重函数之间的差别一目了然：最小二乘的权重是常数，Huber 权重只在 \( |e| > k \) 时才下降，而双权权重在残差一离开零时就下降，并在 \( |e| > k \) 时为零。<sup>[12](http://saedsayad.com/docs/RobustRegression.pdf)</sup> 调节常数在正态模型下权衡稳健性与效率：\( c_H = 1.345 \) 与 \( c_T = 4.685 \) 使相应估计达到 95% 的效率。<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup>

有名称的变体包括：迪克莎·阿迪尔、理查德·彭与苏尚特·萨奇德瓦（2019）为 \( \ell_p \) 回归提出的 \( p \)-IRLS 算法；<sup>[11](https://papers.nips.cc/paper_files/paper/2019/file/46c7cb50b373877fb2f8d5c4517bb969-Paper.pdf)</sup> 将 IRLS 与渐进非凸调度耦合起来的 GNC-IRLS；<sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup> 用于稀疏恢复的一种平滑 \( \ell_p \) 型方案，其权重为 \( w_i = (|x_i|^2 + \epsilon^2)^{-1 + \tau/2} \)，其中 \( 0 < \tau < 1 \)；<sup>[14](https://onlinelibrary.wiley.com/doi/10.1002/cpa.20303)</sup> 以及重加权 \( \ell_1 \) 算法，它迭代地对 \( \ell_1 \) 范数重加权以逼近类 \( \ell_0 \) 准则，在历史上与 IRLS 对 \( \ell_2 \) 范数重加权以逼近类 \( \ell_1 \) 准则的做法平行。<sup>[10](https://people.mines.edu/mwakin/wp-content/uploads/sites/262/2024/06/rwl1-july2008.pdf)</sup>

## 应用

在稳健回归中，当存在离群点时最小二乘表现不佳，此时 IRLS 是计算 M 估计最常用的方法。<sup>[8](https://www.scielo.br/j/bcg/a/TKcjvhcZ5H8gGThh4Rs9MBp/?lang=en)</sup> 它也是标准软件中广义线性模型的拟合算法。<sup>[4](https://myweb.uiowa.edu/pbreheny/uk/teaching/760-s13/notes/2-19.pdf)</sup> 在计算机视觉与信号处理中，IRLS 的各种变体已被用于点云配准、实值相位恢复、无对应关系的回归以及稳健人脸恢复，在这些任务中，IRLS 能处理更多离群点，并且在精度相同时比竞争方法运行得更快。<sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup><sup> • </sup><sup>[15](https://papers.nips.cc/paper_files/paper/2022/file/ba3354bcfeae4f166a8bfe75443ac8f7-Paper-Conference.pdf)</sup> 稀疏恢复与压缩感知使用平滑 \( \ell_p \) 变体和重加权 \( \ell_1 \) 变体。<sup>[14](https://onlinelibrary.wiley.com/doi/10.1002/cpa.20303)</sup><sup> • </sup><sup>[10](https://people.mines.edu/mwakin/wp-content/uploads/sites/262/2024/06/rwl1-july2008.pdf)</sup>

## 局限与替代方法

失效模式取决于代价函数。对 \( L_1 \) 与 \( L_q \) 代价，在残差为零处权重可能变为无穷（未定义），若某次迭代恰好碰到这样的点，算法可能卡住；Huber 与伪 Huber 代价的权重处处有定义，并保证收敛到一个极小点。<sup>[5](https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/e7555537-89f3-466f-9875-fcd4b9d8d035/content)</sup> 对非光滑的 \( \ell_p \) 损失，更新式 \( w_i^{(t+1)} = (r_i^{(t)})^{p-2} \) 在 \( r_i^{(t)} \to 0 \) 时趋于无穷；常见的变通做法是通过 \( w_i^{(t+1)} = \max\{r_i^{(t)}, \epsilon\}^{p-2} \) 对残差做截断。<sup>[2](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)</sup>

对 \( \ell_p \) 回归，基本算法在 \( p \in [1, 3) \) 时于极限意义下收敛（奥斯本，1985），在 \( p \in (1.5, 3) \) 时实际表现可靠，但在 \( p \approx 3.5 \) 这样的中等 \( p \) 下经常发散。<sup>[11](https://papers.nips.cc/paper_files/paper/2019/file/46c7cb50b373877fb2f8d5c4517bb969-Paper.pdf)</sup> 对柯西、布莱克-齐瑟曼和污染高斯等非凸代价，IRLS 只收敛到一个临界点，且可能存在局部极小点，因此不保证全局极小。<sup>[5](https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/e7555537-89f3-466f-9875-fcd4b9d8d035/content)</sup> 由于 Tukey 双权并非单调，算法可能收敛到多个解，需要良好的初值；而对单调的 \( \psi \)，仅凭单调性并不能保证收敛，收敛与否可能依赖初始化；马罗纳及其合作者建议以最小绝对值（LAV）估计作为起点。<sup>[6](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)</sup><sup> • </sup><sup>[16](https://proceedings.mlr.press/v89/mukhoty19a.html)</sup> 稳健性本身也有上限：加权最小二乘估计的崩溃点接近于零，而一个非常稳健的 M 估计量预期可达到 0.5，即理论上限，因为一旦超过一半的数据被污染，真实分布就无法分辨了。<sup>[7](http://www2.peq.coppe.ufrj.br/Pessoal/Professores/Arge/COQ897/DiegoMenezes_etal_2021.pdf)</sup>

与 Newton-Raphson 相比，IRLS 避免计算目标函数的二阶导数，只需基于一阶导数的权重和一次加权最小二乘求解。<sup>[3](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1984.tb01288.x)</sup> 这一基本启发式方法的全局恢复保证，后来由巴斯卡·穆霍蒂及其合作者通过对基本 IRLS 的增强而获得。<sup>[16](https://proceedings.mlr.press/v89/mukhoty19a.html)</sup><sup> • </sup><sup>[17](https://doi.org/10.48550/arxiv.2006.14211)</sup>

## References

1. [Iteratively Reweighted Least Squares - Encyclopedia Entry (DTIC)](https://apps.dtic.mil/sti/tr/pdf/ADA114534.pdf)
2. [On the Convergence of IRLS and Its Variants in Outlier-Robust Estimation (CVPR 2023)](https://openaccess.thecvf.com/content/CVPR2023/papers/Peng_On_the_Convergence_of_IRLS_and_Its_Variants_in_Outlier-Robust_CVPR_2023_paper.pdf)
3. [Iteratively Reweighted Least Squares for Maximum Likelihood Estimation, and Some Robust and Resistant Alternatives (Green, JRSS-B 1984)](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1984.tb01288.x)
4. [GLM estimation and model fitting (course notes)](https://myweb.uiowa.edu/pbreheny/uk/teaching/760-s13/notes/2-19.pdf)
5. [Convergence of Iteratively Re-weighted Least Squares to Robust M-estimators](https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/e7555537-89f3-466f-9875-fcd4b9d8d035/content)
6. [Lecture notes / thesis chapter on iterated weighted least squares and robust regression (University of Jyväskylä)](https://jyx.jyu.fi/bitstreams/7b4a85e0-16ed-4f2e-8472-15498ff940b9/download)
7. [A review on robust M-estimators for regression analysis](http://www2.peq.coppe.ufrj.br/Pessoal/Professores/Arge/COQ897/DiegoMenezes_etal_2021.pdf)
8. [Analytical quality assessment of iteratively reweighted least-squares (IRLS) method (Boletim de Ciências Geodésicas)](https://www.scielo.br/j/bcg/a/TKcjvhcZ5H8gGThh4Rs9MBp/?lang=en)
9. [IRLS in R](https://jmniehaus.github.io/irls.html)
10. [Reweighted ℓ1 algorithms (Candès, Wakin, Boyd draft)](https://people.mines.edu/mwakin/wp-content/uploads/sites/262/2024/06/rwl1-july2008.pdf)
11. [Fast, Provably convergent IRLS Algorithm for p-norm Linear Regression (NeurIPS 2019)](https://papers.nips.cc/paper_files/paper/2019/file/46c7cb50b373877fb2f8d5c4517bb969-Paper.pdf)
12. [Robust Regression (course notes with tables of objective, psi and weight functions)](http://saedsayad.com/docs/RobustRegression.pdf)
13. [Paul W. Holland, Roy E. Welsch (1977). Robust regression using iteratively reweighted least-squares. Communication in Statistics- Theory and Methods.](https://doi.org/10.1080/03610927708827533)
14. [Iteratively reweighted least squares minimization for sparse recovery (Communications on Pure and Applied Mathematics)](https://onlinelibrary.wiley.com/doi/10.1002/cpa.20303)
15. [Global Linear and Local Superlinear Convergence of IRLS for Non-Smooth Robust Regression (NeurIPS 2022)](https://papers.nips.cc/paper_files/paper/2022/file/ba3354bcfeae4f166a8bfe75443ac8f7-Paper-Conference.pdf)
16. [Globally-convergent Iteratively Reweighted Least Squares for Robust Regression Problems (PMLR v89, 2019)](https://proceedings.mlr.press/v89/mukhoty19a.html)
17. [Mukhoty, Bhaskar and colleagues (2020). Globally-convergent Iteratively Reweighted Least Squares for Robust Regression Problems. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2006.14211)
18. [arxiv.org](https://arxiv.org/pdf/1405.5040)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Estimation theory and estimator families › Robust statistics and resampling › Robust regression and outliers in modeling

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/iteratively-reweighted-least-squares

English original: https://www.edgepedia.org/iteratively-reweighted-least-squares
