# 正则化回归

正则化回归是一类回归方法，它在普通最小二乘拟合准则上增加一个惩罚项，从而通过最小化 \( F(\beta) = \mathrm{RSS}(\beta) + \lambda\,\mathrm{Penalty}(\beta) \)（其中 \( \lambda \ge 0 \)）来估计系数。<sup>[1](https://jwmi.github.io/SL/11-Penalized-regression.pdf)</sup> 惩罚项将拟合系数向零收缩，以少量偏差换取方差的降低，从而减小预测误差，尤其在预测变量众多、彼此相关或信息量较弱时更是如此。<sup>[2](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/ridge.pdf)</sup> 岭回归对 \( \sum_j \beta_j^2 \) 施加 \( \ell_2 \) 惩罚，lasso 对 \( \sum_j |\beta_j| \) 施加 \( \ell_1 \) 惩罚，二者是典范情形。<sup>[1](https://jwmi.github.io/SL/11-Penalized-regression.pdf)</sup><sup> • </sup><sup>[3](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup>

| 要点 | 说明 |
|---|---|
| 拟合准则 | \( F(\beta) = \mathrm{RSS}(\beta) + \lambda\,\mathrm{Penalty}(\beta) \)；当 \( \lambda = 0 \) 时岭回归退化为最小二乘<sup>[1](https://jwmi.github.io/SL/11-Penalized-regression.pdf)</sup> |
| 岭回归闭式解 | 当 \( \lambda > 0 \) 时，\( \hat{\beta} = (X^{T} \cdot X + \lambda I)^{-1}X^{T} \cdot Y \)；解唯一且一般为稠密解<sup>[2](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/ridge.pdf)</sup> |
| lasso 稀疏性 | 当 \( X \) 正交时，lasso 解为软阈值化 \( S_\lambda(X^{T} \cdot Y) \)，会将小系数精确置零<sup>[4](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/lasso.pdf)</sup> |
| 弹性网的混合 | 在 glmnet 中，\( \alpha \in [0,1] \) 混合两种惩罚：\( \alpha = 0 \) 为岭回归，\( \alpha = 1 \) 为 lasso<sup>[5](https://cran.r-project.org/web/packages/glmnet/vignettes/glmnet.Rmd)</sup> |
| 标准化 | 岭回归和 lasso 的估计不具有尺度不变性，因此预测变量被标准化为均值 0、方差 1；截距不受惩罚<sup>[6](https://www.stat.uchicago.edu/~yibi/teaching/stat224/L20.pdf)</sup> |
| 调参 | \( \lambda \) 最常通过 K 折交叉验证在交叉验证误差最小处选取<sup>[5](https://cran.r-project.org/web/packages/glmnet/vignettes/glmnet.Rmd)</sup> |
| 各自适用的情形 | 子集选择在少量大效应时表现最好，lasso 在少量到中等数量的中等效应时表现最好，岭回归在大量小效应时表现最好<sup>[3](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup> |

## 工作原理

惩罚项改变了优化的几何结构。岭回归最小化 \( \|Y - X\beta\|^2 + \lambda\|\beta\|^2 \)；在 \( X^TX \) 的对角线上加上 \( \lambda \) 会使每个特征值增加 \( \lambda \)，从而治愈病态条件，且由于准则严格凸，闭式解 \( \hat{\beta} = (X^{T} \cdot X + \lambda I)^{-1}X^{T} \cdot Y \) 存在且唯一。<sup>[2](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/ridge.pdf)</sup> 收缩是非均匀的：系数在低方差主成分方向上收缩更多，在高方差方向上收缩更少。<sup>[2](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/ridge.pdf)</sup> 在标准正交设计下，岭回归的收缩是成比例的，系数只在 \( \lambda \to \infty \) 的极限下才达到零。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC9896544/)</sup>

lasso 最小化 \( (1/2)\|Y - X\beta\|^2 + \lambda\|\beta\|_1 \)，产生具有大量精确零的稀疏解。<sup>[4](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/lasso.pdf)</sup> 当 \( X \) 正交时，其解是逐分量施加的软阈值算子 \( S_\lambda(a) = \mathrm{sign}(a)(|a| - \lambda)_+ \)，而岭回归给出 \( X^{T} \cdot Y/(1+\lambda) \)；正是 \( \ell_1 \) 惩罚在零点处的折角使得有限的 \( \lambda \) 能够将系数精确置零。<sup>[4](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/lasso.pdf)</sup><sup> • </sup><sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC9896544/)</sup>

## 实现方式

由于同一个 \( \lambda \) 被施加于所有系数，预测变量在拟合前被标准化为零均值和单位方差，截距不受惩罚；包括 glmnet 在内的许多软件包默认在内部进行标准化。<sup>[6](https://www.stat.uchicago.edu/~yibi/teaching/stat224/L20.pdf)</sup><sup> • </sup><sup>[8](https://bradleyboehmke.github.io/HOML/regularized-regression.html)</sup> glmnet 包通过循环坐标下降法求解 \( \min \; (1/N)\sum_i w_i\, l(y_i, \beta_0 + \beta^{T} \cdot x_i) + \lambda[(1-\alpha)\|\beta\|^2/2 + \alpha\|\beta\|_1] \)，依次优化每个参数而固定其余参数，并使用 Fortran 核心例程以提高速度。<sup>[5](https://cran.r-project.org/web/packages/glmnet/vignettes/glmnet.Rmd)</sup> 函数 cv.glmnet 执行 K 折交叉验证，损失选项包括偏差、均方误差或平均绝对误差，\( \lambda \) 取在交叉验证误差最小处。<sup>[5](https://cran.r-project.org/web/packages/glmnet/vignettes/glmnet.Rmd)</sup>

## 起源

岭回归由 Arthur E. Hoerl 和 Robert W. Kennard 在 《岭回归：非正交问题的有偏估计》 一文中报告，发表于 1970 年的 Technometrics。<sup>[9](https://doi.org/10.1080/00401706.1970.10488634)</sup> 该文表明，岭估计通过接受少量偏差来大幅降低方差，可以比最小二乘具有更小的均方误差，并引入了岭迹——一种用于展示非正交性影响的二维图解法。<sup>[10](https://homepages.math.uic.edu/~lreyzin/papers/ridge.pdf)</sup> 其名称来源于该估计与“岭分析”在数学上的相似性，后者是一种用于图解二阶响应曲面方程特征的方法。<sup>[11](https://jarad.me/stat615/papers/Ridge_Regression_in_Practice.pdf)</sup> lasso 由 Robert Tibshirani 在 《通过 lasso 进行回归收缩与选择》 一文中报告，发表于 1996 年的 Journal of the Royal Statistical Society Series B。<sup>[12](https://doi.org/10.1111/j.2517-6161.1996.tb02080.x)</sup> 后续的构建模块相继出现：用于计算整条 lasso 路径的 LARS 算法（Efron、Hastie、Johnstone 和 Tibshirani，Annals of Statistics，2004）<sup>[13](https://doi.org/10.1214/009053604000000067)</sup>、弹性网（Zou 和 Hastie，JRSS-B，2005）<sup>[14](https://doi.org/10.1111/j.1467-9868.2005.00503.x)</sup>、自适应 lasso（Zou，JASA，2006）<sup>[15](https://doi.org/10.1198/016214506000000735)</sup>、Dantzig 选择器（Candes 和 Tao，Annals of Statistics，2007）<sup>[16](https://doi.org/10.1214/009053606000001523)</sup>、Park 和 Casella 的贝叶斯 lasso（JASA，2008）<sup>[17](https://doi.org/10.1198/016214508000000337)</sup>、glmnet 中的路径坐标下降法（Friedman、Hastie 和 Tibshirani，Journal of Statistical Software，2010）<sup>[18](https://doi.org/10.18637/jss.v033.i01)</sup>，以及稳定性选择（Meinshausen 和 Bühlmann，JRSS-B，2010）。<sup>[19](https://doi.org/10.1111/j.1467-9868.2010.00740.x)</sup>

## 变体

**弹性网。** 弹性网惩罚是 lasso 和岭回归惩罚的凸组合；在一种参数化下，估计量求解 \( \min_\beta \|Y - X\beta\|^2 + 2\lambda_1 \sum_j |\beta_j| + \lambda_2 \sum_j \beta_j^2 \)，当 \( \lambda_2 = 0 \) 时退化为 lasso。<sup>[14](https://doi.org/10.1111/j.1467-9868.2005.00503.x)</sup><sup> • </sup><sup>[20](https://ar5iv.labs.arxiv.org/html/1405.1796)</sup> 它鼓励一种分组效应，使相关的预测变量倾向于获得相似的系数，并能够选出整组相关变量，而 lasso 无法做到这一点。<sup>[21](https://sites.stat.washington.edu/courses/stat527/s13/readings/zouhastie05.pdf)</sup> 当预测变量高度相关时，它更为可取。<sup>[22](https://pmc.ncbi.nlm.nih.gov/articles/PMC4982098/)</sup>

**自适应 lasso 与非凸惩罚。** 自适应 lasso 使用自适应权重对不同系数施加不同惩罚，并在惩罚序列满足一定条件时具有 oracle 性质：变量选择一致且估计渐近正态。<sup>[15](https://doi.org/10.1198/016214506000000735)</sup> SCAD 惩罚在正则条件下也具有 oracle 性质。<sup>[23](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>

**组 lasso 与选择包装器。** 组 lasso 在预定义组的层面上进行变量选择，在组间表现得像 lasso，在组内则具有类似岭回归的收缩；它无法强制组内稀疏性，且假阳性率相对较高。<sup>[24](https://link.springer.com/article/10.1007/s40745-019-00209-4)</sup><sup> • </sup><sup>[25](https://www.arxiv.org/pdf/2604.03541)</sup> 稳定性选择通过选取在子样本中一致出现的变量来改进对假阳性的控制。<sup>[19](https://doi.org/10.1111/j.1467-9868.2010.00740.x)</sup> 松弛 lasso 用第二个调优参数对选出的变量重新拟合，\( \hat{\beta}_{\mathrm{relax}}(\lambda, \gamma) = \gamma \cdot \hat{\beta}_{\mathrm{lasso}}(\lambda) + (1-\gamma) \cdot \hat{\beta}_{\mathrm{LS}}(\lambda) \)。<sup>[26](https://www.jstatsoft.org/article/download/v106i01/4459)</sup> SLOPE 用为自适应变量选择而设计的排序 \( \ell_1 \) 惩罚替代 \( \ell_1 \) 惩罚。<sup>[27](https://doi.org/10.1214/15-aoas842)</sup>

## 应用

在基因组学等宽数据场景中，正则化至关重要，那里的变量是单核苷酸多态性，数量可达数百万，文档分类中则涉及数万个词项。<sup>[28](https://arxiv.org/pdf/2006.00371)</sup> 在每变量事件数较少的临床风险预测中，岭回归和 lasso 在校准、区分度和预测精度上优于标准 Cox 回归，当每变量事件数低于 10 时收缩被认为是必要的，在 10 到 20 之间则是可取的。<sup>[22](https://pmc.ncbi.nlm.nih.gov/articles/PMC4982098/)</sup>

从数量上看，增益取决于信号结构。在 Tibshirani 的模拟场景中，当真实情形具有大量小效应时，岭回归以明显优势表现最佳，而子集选择在少量大效应时表现最佳。<sup>[3](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup> 在四个模拟例子中，弹性网相对于 lasso 将预测误差降低了 15%、18%、3% 和 27%。<sup>[21](https://sites.stat.washington.edu/courses/stat527/s13/readings/zouhastie05.pdf)</sup> 在对七种惩罚方法的实证比较中，没有一种方法取得无争议的胜利：在无相关或弱相关下，lasso 和自适应 lasso 在排序方面具有竞争力，而在高相关下岭回归往往最佳。<sup>[23](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>

## 局限与替代方法

**偏差与过度收缩。** 岭回归和 lasso 的估计偏向零；岭回归比普通最小二乘获得更小的方差，尤其在多重共线性下，但 lasso 在多重共线性下不如岭回归表现好。<sup>[6](https://www.stat.uchicago.edu/~yibi/teaching/stat224/L20.pdf)</sup> 如果真实系数向量是稠密的，岭回归往往更好，因为 lasso 的稀疏解与真实情形不匹配。<sup>[1](https://jwmi.github.io/SL/11-Penalized-regression.pdf)</sup>

**选择的不稳定性。** 当一个相关组中的所有预测变量都有贡献时，lasso 倾向于只选出其中少数几个，实际上是随机的。<sup>[24](https://link.springer.com/article/10.1007/s40745-019-00209-4)</sup><sup> • </sup><sup>[22](https://pmc.ncbi.nlm.nih.gov/articles/PMC4982098/)</sup> 一致的变量选择还需要比一致预测强得多的条件，包括 beta-min 条件和不可表示条件（lasso 正确选择预测变量的数学条件），而交叉验证得到的预测最优 \( \lambda \) 可能包含许多假阳性，因此用于选择时应取比用于预测更大的 \( \lambda \)。<sup>[23](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>

**推断。** 对正则化选出的变量施加标准 t 检验会产生有偏估计和膨胀的第一类错误率；去偏 lasso 构造一个校正估计量，其置信区间具有最优大小且对非高斯噪声稳健。<sup>[25](https://www.arxiv.org/pdf/2604.03541)</sup> 去偏 lasso 使高维模型中的逐分量假设检验成为可能，在稀疏、无相关的设定下表现良好，但当真实情形不稀疏时会退化。<sup>[24](https://link.springer.com/article/10.1007/s40745-019-00209-4)</sup> 方差未知的选择性推断可以通过平方根 lasso 处理。<sup>[29](https://doi.org/10.1093/biomet/asy045)</sup>

**替代方法。** 岭回归和主成分回归在模拟中基本不受相关数据的影响，其平均绝对偏差小于 lasso 和弹性网，因为它们的解是稠密的。<sup>[24](https://link.springer.com/article/10.1007/s40745-019-00209-4)</sup> 贝叶斯收缩先验给出与惩罚众数相同的估计量。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC9896544/)</sup> 没有单一的正则化方法普遍最优，而通过 SURE 或交叉验证进行数据驱动的调参在高维设定下表现一致良好。<sup>[30](https://economics.mit.edu/sites/default/files/publications/rest_a_00812.pdf)</sup>

## References

1. [Lecture 11: Penalized regression, Statistical Learning (BST 263)](https://jwmi.github.io/SL/11-Penalized-regression.pdf)
2. [High-Dimensional Regression: Ridge (lecture notes, Ryan Tibshirani, UC Berkeley)](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/ridge.pdf)
3. [Regression Shrinkage and Selection Via the Lasso (Tibshirani, JRSS-B 58(1):267–288, 1996)](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)
4. [High-Dimensional Regression: Lasso (lecture notes, Ryan Tibshirani, UC Berkeley)](https://www.stat.berkeley.edu/~ryantibs/statlearn-s24/lectures/lasso.pdf)
5. [An Introduction to glmnet (CRAN vignette)](https://cran.r-project.org/web/packages/glmnet/vignettes/glmnet.Rmd)
6. [STAT 224 Lecture 20: Ridge and Lasso Regressions (University of Chicago)](https://www.stat.uchicago.edu/~yibi/teaching/stat224/L20.pdf)
7. [Regularization approaches in clinical biostatistics: A review of methods and their applications](https://pmc.ncbi.nlm.nih.gov/articles/PMC9896544/)
8. [Chapter 6 Regularized Regression | Hands-On Machine Learning with R (Boehmke)](https://bradleyboehmke.github.io/HOML/regularized-regression.html)
9. [Arthur E. Hoerl, Robert W. Kennard (1970). Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics.](https://doi.org/10.1080/00401706.1970.10488634)
10. [Ridge Regression: Biased Estimation for Nonorthogonal Problems (Hoerl & Kennard, Technometrics 1970, full text)](https://homepages.math.uic.edu/~lreyzin/papers/ridge.pdf)
11. [Ridge Regression in Practice (course-hosted copy of a published practice review)](https://jarad.me/stat615/papers/Ridge_Regression_in_Practice.pdf)
12. [Robert Tibshirani (1996). Regression Shrinkage and Selection Via the Lasso. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.2517-6161.1996.tb02080.x)
13. [Bradley Efron and colleagues (2004). Least angle regression. The Annals of Statistics.](https://doi.org/10.1214/009053604000000067)
14. [Hui Zou, Trevor Hastie (2005). Regularization and Variable Selection Via the Elastic Net. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.1467-9868.2005.00503.x)
15. [Hui Zou (2006). The Adaptive Lasso and Its Oracle Properties. Journal of the American Statistical Association.](https://doi.org/10.1198/016214506000000735)
16. [Emmanuel Candes, Terence Tao (2007). The Dantzig selector: Statistical estimation when p is much larger than n. The Annals of Statistics.](https://doi.org/10.1214/009053606000001523)
17. [Trevor Park, George Casella (2008). The Bayesian Lasso. Journal of the American Statistical Association.](https://doi.org/10.1198/016214508000000337)
18. [Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software.](https://doi.org/10.18637/jss.v033.i01)
19. [Nicolai Meinshausen, Peter Bühlmann (2010). Stability Selection. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.1467-9868.2010.00740.x)
20. [Comparisons of penalized least squares methods by simulations](https://ar5iv.labs.arxiv.org/html/1405.1796)
21. [Regularization and variable selection via the elastic net (Zou & Hastie 2005, JRSS B)](https://sites.stat.washington.edu/courses/stat527/s13/readings/zouhastie05.pdf)
22. [Review and evaluation of penalised regression methods for risk prediction in low-dimensional data with few events](https://pmc.ncbi.nlm.nih.gov/articles/PMC4982098/)
23. [High-dimensional regression in practice: an empirical study of finite-sample prediction, variable selection and ranking](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)
24. [On Regularisation Methods for Analysis of High Dimensional Data (Annals of Data Science)](https://link.springer.com/article/10.1007/s40745-019-00209-4)
25. [Survey of regularization frameworks with 134,400 simulations (arXiv preprint, post-2023)](https://www.arxiv.org/pdf/2604.03541)
26. [Elastic Net Regularization Paths for All Generalized Linear Models (Journal of Statistical Software)](https://www.jstatsoft.org/article/download/v106i01/4459)
27. [Małgorzata Bogdan and colleagues (2015). SLOPE, Adaptive variable selection via convex optimization. The Annals of Applied Statistics.](https://doi.org/10.1214/15-aoas842)
28. [Ridge regularization: an essential concept in data science (Hastie, 2020, arXiv)](https://arxiv.org/pdf/2006.00371)
29. [Xiaoying Tian, Joshua R Loftus, Jonathan E Taylor (2018). Selective inference with unknown variance via the square-root lasso. Biometrika.](https://doi.org/10.1093/biomet/asy045)
30. [Choosing among Regularized Estimators in Empirical Economics: The Risk of Machine Learning (Review of Economics and Statistics)](https://economics.mit.edu/sites/default/files/publications/rest_a_00812.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Regression analysis › Regularized and sparse regression

Copyright 2026 Edgepedia

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

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

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