# 稀疏回归

稀疏回归在拟合线性模型的同时，迫使大多数系数恰好为零，从而用一种方法同时完成高维数据上的预测与变量选择。当预测变量个数 p 超过观测个数 n 时，普通最小二乘仍可计算，但解一般不唯一；而当 p 接近 n 时，它会产生不稳定、难以解释的拟合。<sup>[30](https://math.ucla.edu/~njhu/notes/nla/lsq/leastsquares/)</sup> 稀疏估计量则最小化损失加惩罚项，由惩罚项把冗余系数置零，得到更易解释、也更稳定的模型。

| 关键事实 | 细节 |
|---|---|
| Lasso 目标函数 | 最小化 \( \tfrac{1}{2}\|y - X\beta\|_{2}^{2} + \lambda\|\beta\|_{1} \)；\( L_{1} \) 惩罚产生精确的零 <sup>[1](https://cims.nyu.edu/~cfgranda/pages/MTDS_spring20/notes/sparse_regression.pdf)</sup> |
| 最小的凸稀疏惩罚 | \( q = 1 \) 是 \( L_{q} \) 族中使问题保持凸性的最小指数 <sup>[2](https://www.ime.unicamp.br/~dias/SLS.pdf)</sup> |
| 坐标更新 | 软阈值 \( S_{\alpha}(\mu) = \mathrm{sign}(\mu)\max\{|\mu| - \alpha, 0\} \) <sup>[3](https://www.stat.berkeley.edu/~ryantibs/statlearn-s23/lectures/lasso.pdf)</sup> |
| 调参 | 在 100 个对数间隔的 \( \lambda \) 值网格上做 K 折交叉验证；可选 `lambda.min` 或正则化更强的 `lambda.1se` <sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup> |
| 饱和性 | lasso 解的非零系数至多有 \( \min\{n, d\} \) 个 <sup>[3](https://www.stat.berkeley.edu/~ryantibs/statlearn-s23/lectures/lasso.pdf)</sup> |
| 选择一致性 | 要求设计矩阵满足不可表示条件，而相关预测变量很容易使其失效 <sup>[5](https://sites.stat.washington.edu/courses/stat527/s14/readings/meinshausenyu09.pdf)</sup> |
| 参考软件 | glmnet（Fortran 内核，坐标下降）、ncvreg（SCAD、MCP）、flare（Dantzig 选择子）、c060（稳定性选择） <sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup>，<sup>[6](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup> |

## 工作原理

lasso 估计最小化平方误差损失加 \( \lambda\|\beta\|_{1} \)。<sup>[1](https://cims.nyu.edu/~cfgranda/pages/MTDS_spring20/notes/sparse_regression.pdf)</sup> 直接最小化非零系数的 \( L_{0} \) 计数是棘手的；凸的 \( L_{1} \) 范数能促进稀疏性。<sup>[1](https://cims.nyu.edu/~cfgranda/pages/MTDS_spring20/notes/sparse_regression.pdf)</sup> 在 \( L_{q} \) 惩罚族中，子集选择对应于 \( q \to 0 \)，而 \( q = 1 \) 是能得到凸问题的最小取值；正是凸性加上稀疏性，才使算法能扩展到数百万个参数。<sup>[2](https://www.ime.unicamp.br/~dias/SLS.pdf)</sup>

从机制上看，稀疏性通过软阈值进入：对于正交设计，lasso 解为 \( \hat{\beta} = S_{\lambda}(X^{T}y) \)，它把每个系数朝零方向平移 \( \lambda \)，并把较小的系数截断为恰好零；而岭回归把 \( X^{T}y \) 除以 \( 1 + \lambda \)，对一切都做收缩，却什么也不剔除。<sup>[3](https://www.stat.berkeley.edu/~ryantibs/statlearn-s23/lectures/lasso.pdf)</sup> 押注稀疏性的理由，是 哈斯蒂（Hastie）、蒂布希拉尼（Tibshirani）与温赖特（Wainwright）提出的原则：采用一种在稀疏问题中表现良好的方法，因为在稠密问题中没有方法表现良好。<sup>[2](https://www.ime.unicamp.br/~dias/SLS.pdf)</sup>

## 具体做法

标准工作流使用 glmnet R 包，它拟合弹性网目标 \( \tfrac{1}{2N}\sum(y_{i} - \beta_{0} - x_{i}^{T}\beta)^{2} + \lambda[(1-\alpha)\|\beta\|_{2}^{2}/2 + \alpha\|\beta\|_{1}] \)，默认 \( \alpha = 1 \)（lasso），\( \alpha = 0 \) 则为岭回归。<sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup>

1. **标准化**预测变量，使惩罚对它们一视同仁。
2. **设定路径**：glmnet 先计算 \( \lambda_{\max} \)，即令所有系数为零的最小 \( \lambda \)，然后拟合 100 个对数间隔的值，一直降到 \( \lambda_{\min} \)；当 \( p > n \) 时，比值 \( \lambda_{\min}/\lambda_{\max} \) 默认为 \( 10^{-2} \)，否则为 \( 10^{-4} \)。<sup>[7](https://www.jstatsoft.org/article/download/v106i01/4459)</sup>
3. **用循环坐标下降拟合**，每次固定其余参数、只优化一个参数，并用强规则限制活跃集，沿路径使用热启动。<sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup> 每一次单坐标更新都是一次软阈值。<sup>[8](https://slinderman.github.io/stats305b/lectures/06_sparse_glms_solns.html)</sup>
4. **用 K 折交叉验证调 \( \lambda \)**（`cv.glmnet`），选择 `lambda.min` 或 `lambda.1se`，后者是在最小值一个标准误范围内正则化最强的模型。<sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup>
5. **在留出数据上验证**；当预测变量存在相关分组时，取中间值的 \( \alpha \)（如 0.5）往往会整组选入或整组剔除。<sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup>

同一套机制覆盖线性、逻辑、多项、泊松和 Cox 模型 <sup>[4](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)</sup>；scikit-learn 的 `Lasso` 使用类似的坐标下降求解器。<sup>[8](https://slinderman.github.io/stats305b/lectures/06_sparse_glms_solns.html)</sup>

## 起源

lasso 论文是罗伯特·蒂布希拉尼（Robert Tibshirani）1996 年发表于《皇家统计学会杂志 B 辑》的文章。<sup>[9](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup> 蒂布希拉尼（Tibshirani）自己的回顾文章梳理了它的谱系：该方法受利奥·布雷曼（Leo Breiman）的非负 garotte 启发，而后者在 \( p > n \) 时无定义，因为它所重新缩放的最小二乘估计不唯一——无穷多个系数向量都能最小化残差平方和，伪逆只不过选出其中范数最小的一个——于是蒂布希拉尼（Tibshirani）去掉“中间人”，直接对系数施加惩罚 <sup>[10](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>，。<sup>[11](https://ssc.ca/sites/default/files/data/Members/public/Publications/BookFiles/Book/79-91.pdf)</sup> 更早，弗兰克（Frank）与弗里德曼（Friedman）1993 年发表于《技术计量学》的论文讨论了带 \( L_{q} \) 惩罚的桥回归 <sup>[12](https://doi.org/10.1080/00401706.1993.10485033)</sup>；在信号处理领域，陈（Chen）、多诺霍（Donoho）与桑德斯（Saunders）于 1998 年提出基追踪，把信号分解为字典叠加，并使系数向量的 \( L_{1} \) 范数最小。<sup>[13](https://doi.org/10.1137/s1064827596304010)</sup> 先驱工作还包括岭回归（霍尔（Hoerl）与肯纳德（Kennard），1970）<sup>[14](https://doi.org/10.1080/00401706.1970.10488634)</sup> 以及分支定界最优子集算法 Leaps and Bounds（弗尼瓦尔（Furnival）与威尔逊（Wilson），1974）。<sup>[15](https://doi.org/10.1080/00401706.1974.10489231)</sup> 1996 年的这篇论文起初并未引起多少注意，蒂布希拉尼（Tibshirani）将其归因于当时计算速度慢、算法黑箱化，以及大规模数据问题在当时还很罕见。<sup>[10](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>

## 变体

- **弹性网**（邹（Zou）与哈斯蒂（Hastie），2005）加入 \( L_{2} \) 项，保证任意设计下解的唯一性，把岭回归的预测表现与 lasso 的稀疏性结合起来，并促成一种分组效应：相关预测变量同进同出。<sup>[16](https://doi.org/10.1111/j.1467-9868.2005.00503.x)</sup>
- **自适应 lasso**（邹（Zou），2006）在 L1 惩罚中使用数据驱动的权重，具备神谕性质，表现得就像事先已知真实模型一样。<sup>[17](https://doi.org/10.1198/016214506000000735)</sup>
- **SCAD**（范（Fan）与李（Li），2001）是一种非凹惩罚，对较大的系数不过度惩罚，同时保持解的连续性。<sup>[18](https://doi.org/10.1198/016214501753382273)</sup>
- **MCP**（张（Zhang），2010）是一种极小极大凹惩罚，同样以无偏性为目标；SparseNet 把坐标下降扩展到此类非凸惩罚 <sup>[19](https://doi.org/10.1214/09-aos729)</sup>，。<sup>[20](https://doi.org/10.1198/jasa.2011.tm09738)</sup>
- **组 lasso**（袁（Yuan）与林（Lin），2005）对整个系数组施加惩罚；稀疏组 lasso（西蒙（Simon）、弗里德曼（Friedman）、哈斯蒂（Hastie）与蒂布希拉尼（Tibshirani），2012）把组间稀疏性与组内稀疏性结合起来 <sup>[21](https://doi.org/10.1111/j.1467-9868.2005.00532.x)</sup>，。<sup>[22](https://doi.org/10.1080/10618600.2012.681250)</sup>
- **Dantzig 选择子**（坎德斯（Candes）与陶（Tao），2007）针对 \( p \) 远大于 \( n \) 时的估计问题。<sup>[23](https://doi.org/10.1214/009053606000001523)</sup>
- **松弛 lasso**（迈因斯豪森（Meinshausen），2007）在 lasso 选出的变量上重新拟合最小二乘，抵消收缩。<sup>[7](https://www.jstatsoft.org/article/download/v106i01/4459)</sup>
- **稳定性选择**（迈因斯豪森（Meinshausen）与比尔曼（Bühlmann），2010）把子采样与选择结合起来，以控制期望的假阳性。<sup>[24](https://doi.org/10.1111/j.1467-9868.2010.00740.x)</sup>

## 应用

基因组学是 \( p \gg n \) 情形下的旗舰场景。一项系统性基准比较了 Lasso、自适应 Lasso、弹性网、岭回归、SCAD、Dantzig 选择子和稳定性选择在不同 \( n \)、\( p \)、稀疏度与信噪比下的表现，为方法选择提供了有限样本下的指导。<sup>[6](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup> 一项基因组学基准研究进一步在 \( p \gg n \) 数据上比较了贝叶斯 LASSO、马蹄先验与尖峰-平板先验、SUSIE 以及经典惩罚方法，发现弹性网在相关特征上表现更好。<sup>[25](https://pmc.ncbi.nlm.nih.gov/articles/PMC12888550/)</sup>

## 局限与替代方案

**相关预测变量**是主要的失效模式：lasso 倾向于从一组相关变量中挑出一个，在多重共线性下不稳定。<sup>[25](https://pmc.ncbi.nlm.nih.gov/articles/PMC12888550/)</sup> **收缩偏差**会影响大系数；松弛 lasso 与非凸惩罚可加以应对。<sup>[7](https://www.jstatsoft.org/article/download/v106i01/4459)</sup> **非不变性**：在重参数化下——例如改变分类控制变量的基线类别——基于稀疏性的估计可能移动两个标准误甚至更多，而普通最小二乘却保持不变。<sup>[26](https://www.princeton.edu/~mkolesar/papers/fragility.pdf)</sup>

支撑恢复是更苛刻的目标。只有当设计满足不可表示条件时，lasso 的稀疏模式才可能渐近地与真实模式一致，而高度相关的变量很容易违反该条件；赵（Zhao）与于（Yu）、邹（Zou），以及迈因斯豪森（Meinshausen）与比尔曼（Bühlmann）都证明该条件是符号一致性的必要条件。<sup>[5](https://sites.stat.washington.edu/courses/stat527/s14/readings/meinshausenyu09.pdf)</sup> 即便把条件放宽，只要 \( \lambda \propto \sigma\sqrt{(\log p)/n} \)，仍能得到 \( L_{2} \) 一致性。<sup>[5](https://sites.stat.washington.edu/courses/stat527/s14/readings/meinshausenyu09.pdf)</sup> 近期工作集中于选择后推断：2024 年《Metrika》的一篇论文提出稀疏化同时置信区间，把基于自助法的模型选择与重新拟合结合起来，其所有变体都在保持有效覆盖率的同时宽度窄于包括表现最佳的去偏 lasso 同时置信区间在内的替代方案，代价是对最小信号强度施加 beta-min 条件。<sup>[27](https://link.springer.com/article/10.1007/s00184-024-00975-z)</sup>

与替代方案相比：在低信噪比下 lasso 优于最优子集与前向逐步回归，在高信噪比下则相反，而松弛 lasso 在所有信噪比水平上都有竞争力。<sup>[28](https://www.stat.berkeley.edu/~ryantibs/papers/bestsubset-sts.pdf)</sup> 岭回归给出非稀疏解，不做变量选择。<sup>[6](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup> 最优子集是 NP 难的。<sup>[28](https://www.stat.berkeley.edu/~ryantibs/papers/bestsubset-sts.pdf)</sup> 预条件（Puffer 变换）可以在 \( n \geq p \) 时把设计正交化，从而绕开不可表示条件。<sup>[29](https://pages.stat.wisc.edu/~karlrohe/preconditioning.pdf)</sup>

## References

1. [Sparse Regression lecture notes (Carlos Fernandez-Granda, NYU)](https://cims.nyu.edu/~cfgranda/pages/MTDS_spring20/notes/sparse_regression.pdf)
2. [Statistical Learning with Sparsity (Hastie, Tibshirani & Wainwright, textbook)](https://www.ime.unicamp.br/~dias/SLS.pdf)
3. [High-Dimensional Regression: Lasso (Tibshirani lecture notes, Berkeley StatLearn 2023)](https://www.stat.berkeley.edu/~ryantibs/statlearn-s23/lectures/lasso.pdf)
4. [An Introduction to glmnet (official software vignette)](https://trevorhastie.r-universe.dev/glmnet/doc/glmnet.html)
5. [Lasso-type recovery of sparse representations for high-dimensional data (Meinshausen & Yu, 2009)](https://sites.stat.washington.edu/courses/stat527/s14/readings/meinshausenyu09.pdf)
6. [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)
7. [Elastic Net Regularization Paths for All Generalized Linear Models (Journal of Statistical Software)](https://www.jstatsoft.org/article/download/v106i01/4459)
8. [Sparse GLMs, STATS 305B lecture notes (Scott Linderman, Stanford)](https://slinderman.github.io/stats305b/lectures/06_sparse_glms_solns.html)
9. [Regression Shrinkage and Selection Via the Lasso (Tibshirani, JRSS-B 1996)](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)
10. [Regression shrinkage and selection via the lasso: a retrospective (Tibshirani, JRSS-B 2011)](https://tibshirani.su.domains/ftp/lasso-retro.pdf)
11. [Lasso and Sparsity in Statistics (Tibshirani book chapter)](https://ssc.ca/sites/default/files/data/Members/public/Publications/BookFiles/Book/79-91.pdf)
12. [lldiko E. Frank, Jerome H. Friedman (1993). A Statistical View of Some Chemometrics Regression Tools. Technometrics.](https://doi.org/10.1080/00401706.1993.10485033)
13. [Scott Shaobing Chen, David L. Donoho, Michael A. Saunders (1998). Atomic Decomposition by Basis Pursuit. SIAM Journal on Scientific Computing.](https://doi.org/10.1137/s1064827596304010)
14. [Arthur E. Hoerl, Robert W. Kennard (1970). Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics.](https://doi.org/10.1080/00401706.1970.10488634)
15. [George M. Furnival, Robert W. Wilson (1974). Regressions by Leaps and Bounds. Technometrics.](https://doi.org/10.1080/00401706.1974.10489231)
16. [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)
17. [Hui Zou (2006). The Adaptive Lasso and Its Oracle Properties. Journal of the American Statistical Association.](https://doi.org/10.1198/016214506000000735)
18. [Jianqing Fan, Runze Li (2001). Variable Selection via Nonconcave Penalized Likelihood and its Oracle Properties. Journal of the American Statistical Association.](https://doi.org/10.1198/016214501753382273)
19. [Cun-Hui Zhang (2010). Nearly unbiased variable selection under minimax concave penalty. The Annals of Statistics.](https://doi.org/10.1214/09-aos729)
20. [Rahul Mazumder, Jerome H. Friedman, Trevor Hastie (2011). SparseNet: Coordinate Descent With Nonconvex Penalties. Journal of the American Statistical Association.](https://doi.org/10.1198/jasa.2011.tm09738)
21. [Ming Yuan, Yi Lin (2005). Model Selection and Estimation in Regression with Grouped Variables. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.1467-9868.2005.00532.x)
22. [Noah Simon and colleagues (2012). A Sparse-Group Lasso. Journal of Computational and Graphical Statistics.](https://doi.org/10.1080/10618600.2012.681250)
23. [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)
24. [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)
25. [Benchmarking Sparse Variable Selection Methods for Genomic Data Analyses](https://pmc.ncbi.nlm.nih.gov/articles/PMC12888550/)
26. [The Fragility of Sparsity (Kolesár)](https://www.princeton.edu/~mkolesar/papers/fragility.pdf)
27. [Sparsified simultaneous confidence intervals for high-dimensional linear models (Metrika, 2024)](https://link.springer.com/article/10.1007/s00184-024-00975-z)
28. [Best Subset, Forward Stepwise or Lasso? Analysis and Recommendations Based on Extensive Comparisons (Hastie, Tibshirani & Tibshirani)](https://www.stat.berkeley.edu/~ryantibs/papers/bestsubset-sts.pdf)
29. [Preconditioning to comply with the Irrepresentable Condition (Jia & Rohe)](https://pages.stat.wisc.edu/~karlrohe/preconditioning.pdf)
30. [Projections and least squares problems, Nicholas Hu](https://math.ucla.edu/~njhu/notes/nla/lsq/leastsquares/)

---
*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 › 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/sparse-regression

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