# 秩回归

秩回归是一种非参数回归方法，它拟合的是数据的秩而非原始值。在统计学中，这意味着从残差的秩来估计回归系数；在可靠性工程中，它意味着对概率图进行最小二乘拟合，该图的纵坐标为中位秩。这两种含义都降低了对离群值和分布假设的敏感性。与曼-惠特尼-威尔科克森秩和检验一样，秩回归不直接使用观测到的响应值，而是使用关于残差秩的信息；估计值还通过离散度准则依赖于残差的大小，而保持响应秩一般并不能保持拟合。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC4248265/)</sup> 回归系数的最小二乘估计量容易受到严重误差的影响，其置信区间还对父分布的非正态性敏感。<sup>[2](https://doi.org/10.1080/01621459.1968.10480934)</sup> 在可靠性软件中，该术语指对绘制在纵轴上的中位秩值进行回归。<sup>[3](https://help.reliasoft.com/reference/life_data_analysis/lda/parameter_estimation.html)</sup>

| 关键事实 | 值 |
|---|---|
| 准则 | 最小化离散度 \( D(\beta) = \sum_{i=1}^{n} R_{c_i}(\beta)(Y_i - \beta X_i) \)，关于 \( \beta \) 分段线性、连续且凸<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup> |
| 崩溃点，Theil–Sen 斜率 | 简单线性回归中为 29.3%，具有有界影响函数<sup>[5](https://home.olemiss.edu/%7Exdang/papers/MTSE.pdf)</sup> |
| 正态误差下相对最小二乘的效率 | 符号得分为 64%，威尔科克森得分为 95%<sup>[6](https://scholarworks.wmich.edu/cgi/viewcontent.cgi?article=2155&context=dissertations)</sup> |
| 保证的最低效率 | 对于具有有限 Fisher 信息的误差，相对最小二乘从不低于 0.864<sup>[7](https://www3.stat.sinica.edu.tw/sstest/password.asp?art=4&num=1&vol=20)</sup> |
| Siegel 重复中位数 | 崩溃点 50%<sup>[8](https://journal.r-project.org/articles/RJ-2023-012/RJ-2023-012.pdf)</sup>；高斯效率 40.5%<sup>[9](https://lirias.kuleuven.be/retrieve/37742)</sup> |
| 可靠性绘图位置 | Benard 中位秩 \( 100(i - 0.3)/(n + 0.4) \)<sup>[10](https://www.itl.nist.gov/div898/handbook/apr/section2/apr221.htm)</sup> |
| 软件 | Rfit（R，BFGS 最小化）<sup>[11](https://doi.org/10.32614/rj-2012-014)</sup>；robslopes（O(n log n)）<sup>[8](https://journal.r-project.org/articles/RJ-2023-012/RJ-2023-012.pdf)</sup>；scikit-learn TheilSenRegressor<sup>[12](https://sklearn.org/stable/auto_examples/linear_model/plot_theilsen.html)</sup> |

## 工作原理

秩回归用一个准则取代了最小化残差平方的最小二乘准则，该准则将残差的基于秩的得分与其大小相结合，而不是仅依赖于它们的排序。估计量是使离散度 \( D(\beta) = \sum_{i=1}^{n} a(R_i(\beta))\,e_i(\beta) \) 最小化的任意 \( \beta \)，其中 \( e_i(\beta) = Y_i - \beta X_i \) 是残差，\( R_i(\beta) \) 是它们的秩，\( a(\cdot) \) 是选定的得分函数；得分的选择决定了估计量的性质，中心化秩（威尔科克森或线性得分）是最常见的特例。<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup><sup> • </sup><sup>[13](https://doi.org/10.1214/aoms/1177692377)</sup> 尽管秩系数依赖于残差的排序，但离散度准则也使用残差的大小，因此秩回归拟合一般不具有对响应的保序变换的不变性。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC4248265/)</sup> 当按 \( x \) 的排序与去趋势残差的排序之间的秩相关显著时，试验斜率被拒绝。<sup>[14](https://ir.cwi.nl/pub/8270/8270D.pdf)</sup>

在简单回归中，广泛使用的 Theil–Sen 估计量是成对差商 \( (Y_j - Y_i)/(X_j - X_i) \) 在满足 \( X_i \ne X_j \) 且 \( i < j \) 的数对上的中位数，预测变量值相同的数对不贡献斜率；一般的秩回归估计量可以看作这些差商的加权中位数。<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup> 当 \( X_i \) 等间距时，两者渐近同等有效；对于不等间距的 \( X_i \)，秩回归估计量渐近更有效。<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup> 在正态误差下，符号估计量和威尔科克森估计量相对最小二乘的渐近相对效率分别为 64% 和 95%<sup>[6](https://scholarworks.wmich.edu/cgi/viewcontent.cgi?article=2155&context=dissertations)</sup>；在具有有限 Fisher 信息的对称误差分布上，效率从不低于 0.864，而最小绝对偏差在高斯误差下仅达到 0.637。<sup>[7](https://www3.stat.sinica.edu.tw/sstest/password.asp?art=4&num=1&vol=20)</sup>

## 如何实施

**排序并最小化。** 实践者用中心化秩或中秩对残差排序<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup>，然后最小化离散度。对于威尔科克森准则，使离散度最小的斜率是 \( N = n(n-1)/2 \) 个成对商数的加权中位数，每个成对斜率的权重为 \( |X_j - X_i| \)<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup>；在 R 包 Rfit 中，凸离散度函数用 optim 的 BFGS 拟牛顿法最小化，默认使用威尔科克森（线性）得分。<sup>[11](https://doi.org/10.32614/rj-2012-014)</sup>

**推断。** Theil 定理给出置信区间为第 \( q \) 个和第 \( (q+1) \) 个有序成对斜率之间的区间，水平为 \( 1 - 2P[q-1 \mid n] \)，其中 \( P[q-1 \mid n] \) 是零假设下的单尾概率<sup>[14](https://ir.cwi.nl/pub/8270/8270D.pdf)</sup>；Sen 的区间同样由斜率集的两个次序统计量确定。<sup>[2](https://doi.org/10.1080/01621459.1968.10480934)</sup> 自助法区间重采样残差或观测对，经验法则是 \( B \ge 1000 \) 次重复。<sup>[4](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)</sup> Rfit 报告 Wald 检验和基于 t 的置信区间，使用基于 tau 的方差估计。<sup>[11](https://doi.org/10.32614/rj-2012-014)</sup>

**可靠性分支。** 每个失效次序数 \( i \) 得到一个绘图位置：Benard 近似。对于右删失数据，Johnson 的秩调整方法将调整秩更新为 \( j_i = j_{i-1} + x_i \cdot I_i \)，其中 \( I_i = ((n+1) - j_{i-1})/(1 + (n - n_i)) \)。<sup>[15](https://rdrr.io/cran/weibulltools/f/vignettes/Life_Data_Analysis_Part_I.Rmd)</sup> 对于分组数据，点绘制在每组中的最高秩处，中位秩由累积二项方程得出。<sup>[16](https://help.reliasoft.com/reference/life_data_analysis/lda/appendix__special_analysis_methods.html)</sup> 两参数威布尔累积分布函数线性化为 \( \log\{-\log[1-F(t)]\} = \beta \cdot \log t - \beta \cdot \log \eta \)，因此在所示的线性化中，形状参数是变换后的失效概率 \( \log\{-\log[1-F(t)]\} \) 关于 \( \log t \) 的斜率。<sup>[15](https://rdrr.io/cran/weibulltools/f/vignettes/Life_Data_Analysis_Part_I.Rmd)</sup> 拟合可以最小化垂直（对 Y 回归）或水平（对 X 回归）偏差。<sup>[3](https://help.reliasoft.com/reference/life_data_analysis/lda/parameter_estimation.html)</sup>

## 起源

成对斜率方法是在一种方法中提出的，其主要目标是在不假设正态性的情况下，利用观测的秩不变性为回归参数构造置信域。<sup>[14](https://ir.cwi.nl/pub/8270/8270D.pdf)</sup> 第二部分将置信域扩展到三个及以上变量的线性回归。<sup>[17](https://dwc.knaw.nl/DL/publications/PU00018803.pdf)</sup> Sen 1968 年发表在《美国统计协会杂志》上的论文将成对斜率估计量扩展到结：点估计量，即在 \( t_i \) 互不相同的数对上斜率 \( (Y_j - Y_i)/(t_j - t_i) \) 的中位数，是无偏的。<sup>[2](https://doi.org/10.1080/01621459.1968.10480934)</sup>

一般线性模型的基于秩（R 估计）框架可追溯到两篇共享优先权的《数理统计年刊》论文：Jurečková 1971 年关于回归系数的非参数估计<sup>[18](https://doi.org/10.1214/aoms/1177693245)</sup> 和 Jaeckel 1972 年通过最小化残差离散度估计回归系数。<sup>[13](https://doi.org/10.1214/aoms/1177692377)</sup> Hettmansperger 和 McKean 1977 年发表在《技术计量学》上的论文发展了线性模型中检验和估计的统一基于秩的方法，相对最小二乘具有稳健性和效率<sup>[19](https://doi.org/10.1080/00401706.1977.10489549)</sup>，McKean 和 Hettmansperger 1978 年发表在《生物计量学》上的论文用牛顿步算法使计算变得可行。<sup>[20](https://doi.org/10.1093/biomet/65.3.571)</sup>

## 变体

**Theil–Sen 与重复中位数。** Theil–Sen 斜率将成对中位数构造与 Sen 的结扩展相结合。Siegel 1982 年的重复中位数估计量用中位数的嵌套中位数取代单一中位数，达到最大崩溃值 50%，可承受高达 50% 的离群值。它以 \( \sqrt{n} \) 速率收敛，高斯效率为 40.5%，其影响函数在 \( x \) 和 \( y \) 两方面都有界，这与最小绝对偏差不同。<sup>[9](https://lirias.kuleuven.be/retrieve/37742)</sup>

**基于秩的线性模型。** Sievers（1983）研究了线性模型中用于估计的加权离散度函数<sup>[21](https://doi.org/10.1080/03610928308828522)</sup>；有界影响秩回归（Naranjo 和 Hettmansperger，1994）针对杠杆点<sup>[22](https://doi.org/10.1111/j.2517-6161.1994.tb01972.x)</sup>；Chang 及其同事（1999）的高崩溃秩回归在因子空间中达到高达 50% 的崩溃点。<sup>[23](https://doi.org/10.1080/01621459.1999.10473836)</sup> 多变量扩展根据穿过各个由 m 个数据点组成的子集的超平面，以及空间 U 分位数，来定义参数向量；在高斯误差下，多变量 Theil–Sen 估计量相对最小二乘的有限样本相对效率约为 70–80%，并且在约 35–40% 的污染下表现良好，而最小二乘则完全崩溃。<sup>[5](https://home.olemiss.edu/%7Exdang/papers/MTSE.pdf)</sup>

**可靠性家族。** 中位秩回归使用中位秩绘图位置对概率图点进行普通最小二乘拟合。<sup>[24](https://doi.org/10.1080/08982112.2010.503447)</sup> 一种针对删失数据的改进秩回归方法充分利用了中止时间，并显示出良好的统计和收敛性质，而 Johnson 方法仅将中止时间用作位置。<sup>[25](https://doi.org/10.1002/qre.575)</sup> ReliaSoft 的排序方法（RRM）为区间和左/右删失数据迭代地重新计算秩和最可能失效时间。

## 应用

可靠性工程是主要的工业应用场景。Weibull++ 使用秩回归这一术语，因为回归是对纵轴上的中位秩值进行的。<sup>[3](https://help.reliasoft.com/reference/life_data_analysis/lda/parameter_estimation.html)</sup> 通常的指导是：对于无严重删失的小样本使用秩回归，当存在严重或不均匀删失、大量区间数据或足够样本量时使用最大似然；最大似然可能需要三十到五十甚至超过一百个精确失效时间，并且其威布尔形状估计在小样本下严重偏倚。<sup>[3](https://help.reliasoft.com/reference/life_data_analysis/lda/parameter_estimation.html)</sup> 2010 年《质量工程》的一项研究发现，在超过 99% 的删失下，基于 MLE 的参数估计即使在对数变换下也服从极度偏斜的分布。<sup>[26](https://www.tandfonline.com/doi/abs/10.1080/08982112.2010.505219)</sup> 相比之下，Genschel 和 Meeker 的大量模拟研究得出结论：在 MSE 类准则下，ML 估计量在其评估区域的绝大部分都优于 MRR 估计量<sup>[24](https://doi.org/10.1080/08982112.2010.503447)</sup>；这两种立场仍未调和。

在其他领域，秩回归已应用于流行病学中含离群值的数据，其中有离群值的模拟给出的第一类错误接近名义值 0.05，而经典模型给出的错误接近 1<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC4248265/)</sup>，以及应用于具有聚类相关误差的线性模型。<sup>[27](https://doi.org/10.1198/jasa.2009.0116)</sup>

## 局限与替代方案

**失效模式。** 对于该文中综述的秩回归方法，估计值和渐近标准误仅对横截面数据可用，因为它们对纵向数据很复杂<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC4248265/)</sup>，尽管其他基于秩的方法处理纵向或相关观测，而秩回归及其扩展不能充分处理纵向研究中的缺失数据。<sup>[28](https://onlinelibrary.wiley.com/doi/10.1002/sim.6930)</sup> 在可靠性工作中，秩回归参数的最小二乘标准误没有统计基础；weibulltools 包从异方差一致协方差矩阵或 Mock 方法计算区间，并推荐使用最大似然进行统计上可接受的推断。<sup>[29](https://tim-tu.github.io/weibulltools/reference/rank_regression.html)</sup> 中位秩回归忽略了最后一次失效后删失观测位置中的信息，其权重建立在残差无相关、等方差的错误假设上。<sup>[24](https://doi.org/10.1080/08982112.2010.503447)</sup> 在秩-秩回归（将一个排序对另一个排序回归）中，同方差和 Eicker–White 稳健方差估计量是无效的，因为它们忽略了秩中的估计误差，并且在有结时斜率取决于结处理参数，可能落在 [−1, 1] 之外，因此不能解释为相关性。<sup>[30](https://arxiv.org/html/2310.15512v5)</sup>

**比较。** 相对于普通最小二乘，威尔科克森得分秩估计量在正态误差下最多牺牲约 5% 的效率（95%）来换取对离群值和重尾的保护，尽管正态误差效率在基于秩的估计量之间差异很大。相对于最小绝对偏差，基于威尔科克森的估计量具有更高的保证效率下限（高斯误差下为 0.864 对 0.637）。<sup>[7](https://www3.stat.sinica.edu.tw/sstest/password.asp?art=4&num=1&vol=20)</sup> 复合分位数回归（Zou 和 Yuan，2008）具有与秩估计量相同的渐近方差，两者都与 Hodges–Lehmann 估计量匹配。相对于广义估计方程，威尔科克森得分秩回归对离群值给出更稳健的估计。<sup>[28](https://onlinelibrary.wiley.com/doi/10.1002/sim.6930)</sup> 在计算上，暴力评估（重复）中位数斜率需要 \( O(n^{2}) \) 时间和空间；robslopes 算法以 \( O(n \log n) \) 和 \( O(n \log^{2} n) \) 期望时间、O(n) 空间运行<sup>[8](https://journal.r-project.org/articles/RJ-2023-012/RJ-2023-012.pdf)</sup>，scikit-learn 建议仅对小问题使用 Theil–Sen，max_subpopulation 选项以数学性质换取运行时间。<sup>[12](https://sklearn.org/stable/auto_examples/linear_model/plot_theilsen.html)</sup>

## References

1. [Rank regression: an alternative regression approach for data with outliers](https://pmc.ncbi.nlm.nih.gov/articles/PMC4248265/)
2. [Pranab Kumar Sen (1968). Estimates of the Regression Coefficient Based on Kendall's Tau. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1968.10480934)
3. [Parameter Estimation (ReliaSoft Life Data Analysis Reference)](https://help.reliasoft.com/reference/life_data_analysis/lda/parameter_estimation.html)
4. [Linear Rank Regression (Robust Estimation of Regression Parameters), S. Sawyer, Washington University](https://www.math.wustl.edu/~sawyer/handouts/RankRegress.pdf)
5. [The Multivariate Theil–Sen Estimator (Dang, Peng, Wang & Wang)](https://home.olemiss.edu/%7Exdang/papers/MTSE.pdf)
6. [Nonlinear Regression Based on Ranks (Western Michigan University dissertation)](https://scholarworks.wmich.edu/cgi/viewcontent.cgi?article=2155&context=dissertations)
7. [Regularized rank regression (R3) for variable selection (Statistica Sinica)](https://www3.stat.sinica.edu.tw/sstest/password.asp?art=4&num=1&vol=20)
8. [robslopes: Efficient Computation of the (Repeated) Median Slope](https://journal.r-project.org/articles/RJ-2023-012/RJ-2023-012.pdf)
9. [Finite-sample efficiency of the repeated median slope estimator](https://lirias.kuleuven.be/retrieve/37742)
10. [NIST/SEMATECH e-Handbook 8.2.2.1 Probability Plotting](https://www.itl.nist.gov/div898/handbook/apr/section2/apr221.htm)
11. [John,D. Kloke, Joseph,W. McKean (2012). Rfit: Rank-based Estimation for Linear Models. The R Journal.](https://doi.org/10.32614/rj-2012-014)
12. [Theil-Sen Regression, scikit-learn documentation](https://sklearn.org/stable/auto_examples/linear_model/plot_theilsen.html)
13. [Louis A. Jaeckel (1972). Estimating Regression Coefficients by Minimizing the Dispersion of the Residuals. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177692377)
14. [A rank-invariant method of linear and polynomial regression analysis, I (H. Theil, 1950)](https://ir.cwi.nl/pub/8270/8270D.pdf)
15. [weibulltools vignette: Life Data Analysis Part I](https://rdrr.io/cran/weibulltools/f/vignettes/Life_Data_Analysis_Part_I.Rmd)
16. [Appendix C: Special Analysis Methods (ReliaSoft)](https://help.reliasoft.com/reference/life_data_analysis/lda/appendix__special_analysis_methods.html)
17. [A rank-invariant method of linear and polynomial regression analysis, II (H. Theil, 1950)](https://dwc.knaw.nl/DL/publications/PU00018803.pdf)
18. [Jana Jureckova (1971). Nonparametric Estimate of Regression Coefficients. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177693245)
19. [Thomas P. Hettmansperger, Joseph W. McKean (1977). A Robust Alternative Based on Ranks to Least Squares in Analyzing Linear Models. Technometrics.](https://doi.org/10.1080/00401706.1977.10489549)
20. [JOSEPH W. MCKEAN, THOMAS P. HETTMANSPERGER (1978). A robust analysis of the general linear model based on one step R-estimates. Biometrika.](https://doi.org/10.1093/biomet/65.3.571)
21. [Gerald L. Sievers (1983). A weighted dispersion function for estimation in linear models. Communication in Statistics- Theory and Methods.](https://doi.org/10.1080/03610928308828522)
22. [J. D. Naranjo, T. P. Hettmansperger (1994). Bounded Influence Rank Regression. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.2517-6161.1994.tb01972.x)
23. [William H. Chang and colleagues (1999). High-Breakdown Rank Regression. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1999.10473836)
24. [A Comparison of Maximum Likelihood and Median-Rank Regression for Weibull Estimation (Genschel & Meeker, Quality Engineering 22(4), 2010)](https://doi.org/10.1080/08982112.2010.503447)
25. [Refined Rank Regression Method with Censors (Wendai Wang, Quality and Reliability Engineering International, 2004)](https://doi.org/10.1002/qre.575)
26. [The Evaluation of Median-Rank Regression and Maximum Likelihood Estimation Techniques for a Two-Parameter Weibull Distribution (Olteanu & Freeman, Quality Engineering 22(4), 2010)](https://www.tandfonline.com/doi/abs/10.1080/08982112.2010.505219)
27. [John D. Kloke, Joseph W. McKean, M. Mushfiqur Rashid (2009). Rank-Based Estimation and Associated Inferences for Linear Models With Cluster Correlated Errors. Journal of the American Statistical Association.](https://doi.org/10.1198/jasa.2009.0116)
28. [Rank-preserving regression: a more robust rank regression model against outliers (Statistics in Medicine)](https://onlinelibrary.wiley.com/doi/10.1002/sim.6930)
29. [rank_regression • weibulltools (R package documentation)](https://tim-tu.github.io/weibulltools/reference/rank_regression.html)
30. [Inference for Rank-Rank Regressions (preprint, revised v5)](https://arxiv.org/html/2310.15512v5)

---
*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 › Regression analysis › Nonparametric and semiparametric regression

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/rank-regression

English original: https://www.edgepedia.org/rank-regression
