正则化回归
正则化回归是一类回归方法,它在普通最小二乘拟合准则上增加一个惩罚项,从而通过最小化 (其中 )来估计系数。1 惩罚项将拟合系数向零收缩,以少量偏差换取方差的降低,从而减小预测误差,尤其在预测变量众多、彼此相关或信息量较弱时更是如此。2 岭回归对 施加 惩罚,lasso 对 施加 惩罚,二者是典范情形。1 • 3
| 要点 | 说明 |
|---|---|
| 拟合准则 | ;当 时岭回归退化为最小二乘1 |
| 岭回归闭式解 | 当 时,;解唯一且一般为稠密解2 |
| lasso 稀疏性 | 当 正交时,lasso 解为软阈值化 ,会将小系数精确置零4 |
| 弹性网的混合 | 在 glmnet 中, 混合两种惩罚: 为岭回归, 为 lasso5 |
| 标准化 | 岭回归和 lasso 的估计不具有尺度不变性,因此预测变量被标准化为均值 0、方差 1;截距不受惩罚6 |
| 调参 | 最常通过 K 折交叉验证在交叉验证误差最小处选取5 |
| 各自适用的情形 | 子集选择在少量大效应时表现最好,lasso 在少量到中等数量的中等效应时表现最好,岭回归在大量小效应时表现最好3 |
工作原理
惩罚项改变了优化的几何结构。岭回归最小化 ;在 的对角线上加上 会使每个特征值增加 ,从而治愈病态条件,且由于准则严格凸,闭式解 存在且唯一。2 收缩是非均匀的:系数在低方差主成分方向上收缩更多,在高方差方向上收缩更少。2 在标准正交设计下,岭回归的收缩是成比例的,系数只在 的极限下才达到零。7
lasso 最小化 ,产生具有大量精确零的稀疏解。4 当 正交时,其解是逐分量施加的软阈值算子 ,而岭回归给出 ;正是 惩罚在零点处的折角使得有限的 能够将系数精确置零。4 • 7
实现方式
由于同一个 被施加于所有系数,预测变量在拟合前被标准化为零均值和单位方差,截距不受惩罚;包括 glmnet 在内的许多软件包默认在内部进行标准化。6 • 8 glmnet 包通过循环坐标下降法求解 ,依次优化每个参数而固定其余参数,并使用 Fortran 核心例程以提高速度。5 函数 cv.glmnet 执行 K 折交叉验证,损失选项包括偏差、均方误差或平均绝对误差, 取在交叉验证误差最小处。5
起源
岭回归由 Arthur E. Hoerl 和 Robert W. Kennard 在 《岭回归:非正交问题的有偏估计》 一文中报告,发表于 1970 年的 Technometrics。9 该文表明,岭估计通过接受少量偏差来大幅降低方差,可以比最小二乘具有更小的均方误差,并引入了岭迹——一种用于展示非正交性影响的二维图解法。10 其名称来源于该估计与“岭分析”在数学上的相似性,后者是一种用于图解二阶响应曲面方程特征的方法。11 lasso 由 Robert Tibshirani 在 《通过 lasso 进行回归收缩与选择》 一文中报告,发表于 1996 年的 Journal of the Royal Statistical Society Series B。12 后续的构建模块相继出现:用于计算整条 lasso 路径的 LARS 算法(Efron、Hastie、Johnstone 和 Tibshirani,Annals of Statistics,2004)13、弹性网(Zou 和 Hastie,JRSS-B,2005)14、自适应 lasso(Zou,JASA,2006)15、Dantzig 选择器(Candes 和 Tao,Annals of Statistics,2007)16、Park 和 Casella 的贝叶斯 lasso(JASA,2008)17、glmnet 中的路径坐标下降法(Friedman、Hastie 和 Tibshirani,Journal of Statistical Software,2010)18,以及稳定性选择(Meinshausen 和 Bühlmann,JRSS-B,2010)。19
变体
弹性网。 弹性网惩罚是 lasso 和岭回归惩罚的凸组合;在一种参数化下,估计量求解 ,当 时退化为 lasso。14 • 20 它鼓励一种分组效应,使相关的预测变量倾向于获得相似的系数,并能够选出整组相关变量,而 lasso 无法做到这一点。21 当预测变量高度相关时,它更为可取。22
自适应 lasso 与非凸惩罚。 自适应 lasso 使用自适应权重对不同系数施加不同惩罚,并在惩罚序列满足一定条件时具有 oracle 性质:变量选择一致且估计渐近正态。15 SCAD 惩罚在正则条件下也具有 oracle 性质。23
组 lasso 与选择包装器。 组 lasso 在预定义组的层面上进行变量选择,在组间表现得像 lasso,在组内则具有类似岭回归的收缩;它无法强制组内稀疏性,且假阳性率相对较高。24 • 25 稳定性选择通过选取在子样本中一致出现的变量来改进对假阳性的控制。19 松弛 lasso 用第二个调优参数对选出的变量重新拟合,。26 SLOPE 用为自适应变量选择而设计的排序 惩罚替代 惩罚。27
应用
在基因组学等宽数据场景中,正则化至关重要,那里的变量是单核苷酸多态性,数量可达数百万,文档分类中则涉及数万个词项。28 在每变量事件数较少的临床风险预测中,岭回归和 lasso 在校准、区分度和预测精度上优于标准 Cox 回归,当每变量事件数低于 10 时收缩被认为是必要的,在 10 到 20 之间则是可取的。22
从数量上看,增益取决于信号结构。在 Tibshirani 的模拟场景中,当真实情形具有大量小效应时,岭回归以明显优势表现最佳,而子集选择在少量大效应时表现最佳。3 在四个模拟例子中,弹性网相对于 lasso 将预测误差降低了 15%、18%、3% 和 27%。21 在对七种惩罚方法的实证比较中,没有一种方法取得无争议的胜利:在无相关或弱相关下,lasso 和自适应 lasso 在排序方面具有竞争力,而在高相关下岭回归往往最佳。23
局限与替代方法
偏差与过度收缩。 岭回归和 lasso 的估计偏向零;岭回归比普通最小二乘获得更小的方差,尤其在多重共线性下,但 lasso 在多重共线性下不如岭回归表现好。6 如果真实系数向量是稠密的,岭回归往往更好,因为 lasso 的稀疏解与真实情形不匹配。1
选择的不稳定性。 当一个相关组中的所有预测变量都有贡献时,lasso 倾向于只选出其中少数几个,实际上是随机的。24 • 22 一致的变量选择还需要比一致预测强得多的条件,包括 beta-min 条件和不可表示条件(lasso 正确选择预测变量的数学条件),而交叉验证得到的预测最优 可能包含许多假阳性,因此用于选择时应取比用于预测更大的 。23
推断。 对正则化选出的变量施加标准 t 检验会产生有偏估计和膨胀的第一类错误率;去偏 lasso 构造一个校正估计量,其置信区间具有最优大小且对非高斯噪声稳健。25 去偏 lasso 使高维模型中的逐分量假设检验成为可能,在稀疏、无相关的设定下表现良好,但当真实情形不稀疏时会退化。24 方差未知的选择性推断可以通过平方根 lasso 处理。29
替代方法。 岭回归和主成分回归在模拟中基本不受相关数据的影响,其平均绝对偏差小于 lasso 和弹性网,因为它们的解是稠密的。24 贝叶斯收缩先验给出与惩罚众数相同的估计量。7 没有单一的正则化方法普遍最优,而通过 SURE 或交叉验证进行数据驱动的调参在高维设定下表现一致良好。30
References
- Lecture 11: Penalized regression, Statistical Learning (BST 263)
- High-Dimensional Regression: Ridge (lecture notes, Ryan Tibshirani, UC Berkeley)
- Regression Shrinkage and Selection Via the Lasso (Tibshirani, JRSS-B 58(1):267–288, 1996)
- High-Dimensional Regression: Lasso (lecture notes, Ryan Tibshirani, UC Berkeley)
- An Introduction to glmnet (CRAN vignette)
- STAT 224 Lecture 20: Ridge and Lasso Regressions (University of Chicago)
- Regularization approaches in clinical biostatistics: A review of methods and their applications
- Chapter 6 Regularized Regression | Hands-On Machine Learning with R (Boehmke)
- Arthur E. Hoerl, Robert W. Kennard (1970). Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics.
- Ridge Regression: Biased Estimation for Nonorthogonal Problems (Hoerl & Kennard, Technometrics 1970, full text)
- Ridge Regression in Practice (course-hosted copy of a published practice review)
- Robert Tibshirani (1996). Regression Shrinkage and Selection Via the Lasso. Journal of the Royal Statistical Society Series B (Statistical Methodology).
- Bradley Efron and colleagues (2004). Least angle regression. The Annals of Statistics.
- Hui Zou, Trevor Hastie (2005). Regularization and Variable Selection Via the Elastic Net. Journal of the Royal Statistical Society Series B (Statistical Methodology).
- Hui Zou (2006). The Adaptive Lasso and Its Oracle Properties. Journal of the American Statistical Association.
- Emmanuel Candes, Terence Tao (2007). The Dantzig selector: Statistical estimation when p is much larger than n. The Annals of Statistics.
- Trevor Park, George Casella (2008). The Bayesian Lasso. Journal of the American Statistical Association.
- Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software.
- Nicolai Meinshausen, Peter Bühlmann (2010). Stability Selection. Journal of the Royal Statistical Society Series B (Statistical Methodology).
- Comparisons of penalized least squares methods by simulations
- Regularization and variable selection via the elastic net (Zou & Hastie 2005, JRSS B)
- Review and evaluation of penalised regression methods for risk prediction in low-dimensional data with few events
- High-dimensional regression in practice: an empirical study of finite-sample prediction, variable selection and ranking
- On Regularisation Methods for Analysis of High Dimensional Data (Annals of Data Science)
- Survey of regularization frameworks with 134,400 simulations (arXiv preprint, post-2023)
- Elastic Net Regularization Paths for All Generalized Linear Models (Journal of Statistical Software)
- Małgorzata Bogdan and colleagues (2015). SLOPE, Adaptive variable selection via convex optimization. The Annals of Applied Statistics.
- Ridge regularization: an essential concept in data science (Hastie, 2020, arXiv)
- Xiaoying Tian, Joshua R Loftus, Jonathan E Taylor (2018). Selective inference with unknown variance via the square-root lasso. Biometrika.
- Choosing among Regularized Estimators in Empirical Economics: The Risk of Machine Learning (Review of Economics and Statistics)
Initially written Sep 29, 2026 · Edited: Oct 15, 2026
你的笔记
© 2026 Biostate AI。依据 Edgepedia Community License,注明出处即可免费使用。 嵌入参考卡片。