# 套索（统计学）

套索（lasso，即最小绝对收缩与选择算子）是 Robert Tibshirani 于 1996 年提出的一种回归技术，它在系数绝对值之和的一个由常数给出的上界约束下最小化残差平方和；由于这一约束，某些系数通常会被压到恰好为 0，这使所得模型具有可解释性。<sup>[1](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup> 它结合了子集选择的可解释性与岭回归的稳定性。

| 关键事实 | 详情 |
|---|---|
| 定义 | 带 L1 惩罚 \( \lambda \sum_j \|\beta_j\| \) 的最小二乘；与岭回归不同，某些系数会被恰好设为零<sup>[1](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup><sup> • </sup><sup>[2](https://glmnet.stanford.edu/reference/glmnet.html)</sup> |
| 调参 | \( \lambda \) 控制稀疏度；由 K 折交叉验证（K = 5 或 10）选取，常配合 1-SE 规则，即偏向简约<sup>[3](https://stat.ethz.ch/education/semesters/ss2016/sparsity/sparsity-ETH.pdf)</sup><sup> • </sup><sup>[4](https://hastie.su.domains/Papers/glmnet.pdf)</sup><sup> • </sup><sup>[5](https://www.ime.unicamp.br/~dias/SLS.pdf)</sup> |
| 选择理论 | 一致的变量选择需要 beta-min 条件（\( \min \|\beta_{0j}\| \gtrsim \sqrt{s_0 \log(p)/n} \)）以及设计矩阵上的不可表示条件<sup>[6](https://stat.ethz.ch/Manuscripts/buhlmann/EMS-surveys.pdf)</sup><sup> • </sup><sup>[7](https://jmlr.org/papers/volume7/zhao06a/zhao06a.pdf)</sup> |
| 维度限制 | 在 p > n 的情形下，套索至多能选出 n 个变量；弹性网则无此限制<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup> |
| 相关预测变量 | 套索倾向于从一组相关变量中挑出一个，且无法同时选出两个完全相同的预测变量；弹性网正是为解决这一问题而设计<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC3363152/)</sup><sup> • </sup><sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup> |
| 推断 | 在套索选择之后直接套用未加调整的普通 t 检验可能无效；有效推断可使用去偏套索、样本分割或精确的选择后推断<sup>[11](https://www.arxiv.org/pdf/2604.03541)</sup><sup> • </sup><sup>[12](https://link.springer.com/article/10.1186/s12874-026-02887-0)</sup> |
| 软件 | glmnet（自 2008 年起在 CRAN 上）用循环坐标下降拟合路径；LARS 是更早的专用算法<sup>[2](https://glmnet.stanford.edu/reference/glmnet.html)</sup><sup> • </sup><sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup><sup> • </sup><sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup> |

## 形式化与几何

在 glmnet 软件所用的参数化中，高斯响应的目标函数为 \( \tfrac{1}{2} \mathrm{RSS}/n + \lambda \cdot \text{penalty} \)，其中混合参数 \( \alpha = 1 \) 给出套索解路径，其他取值给出弹性网<sup>[2](https://glmnet.stanford.edu/reference/glmnet.html)</sup>。惩罚项为 L1 范数 \( \lambda \sum_j \|\beta_j\| \)：它将系数向零收缩，其中一些被恰好设为零，而 \( \lambda \) 控制收缩量与稀疏程度<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>。\( \lambda \) 取值越大，解越稀疏，即被设为零的条目越多<sup>[3](https://stat.ethz.ch/education/semesters/ss2016/sparsity/sparsity-ETH.pdf)</sup>。

稀疏性来自惩罚项的 L1 几何，它给出的估计量某些分量恰好为零，稀疏程度由正则化参数控制。这与 L2（岭）正则化形成对比，后者一般不会产生稀疏性<sup>[6](https://stat.ethz.ch/Manuscripts/buhlmann/EMS-surveys.pdf)</sup><sup> • </sup><sup>[14](https://www.stat.cmu.edu/~larry/=sml/sparsity.pdf)</sup>。套索将较大的最小二乘系数向零收缩 \( \lambda \)，因此被选中的系数存在向下偏倚<sup>[14](https://www.stat.cmu.edu/~larry/=sml/sparsity.pdf)</sup><sup> • </sup><sup>[23](https://myweb.uiowa.edu/pbreheny/7240/s19/notes/2-13.pdf)</sup>。

## 选择调优参数

调优参数通常由预测误差、留出的验证集或 K 折交叉验证来选取；K 的典型取值为 5 或 10<sup>[4](https://hastie.su.domains/Papers/glmnet.pdf)</sup><sup> • </sup><sup>[5](https://www.ime.unicamp.br/~dias/SLS.pdf)</sup>。Tibshirani 的原始论文在归一化参数 s 从 0 到 1 的网格上，用五折交叉验证估计预测误差<sup>[1](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup>。实践者常使用一倍标准误规则，它承认风险曲线是带误差估计出来的，并偏向简约；1-SE 变体 \( \lambda_{\mathrm{CV,1SE}} \) 偏向更简约的模型，同时保持可比的预测性能<sup>[4](https://hastie.su.domains/Papers/glmnet.pdf)</sup><sup> • </sup><sup>[12](https://link.springer.com/article/10.1186/s12874-026-02887-0)</sup>。

信息准则提供了另一种选择。在一项 2025 年的模拟研究中，AIC 与交叉验证产生了相似结果，且优于 BIC，但在信息充足的情形下 BIC 表现更好；此外已知在正则条件下，BIC 类准则能给出一致的变量选择<sup>[15](https://www.mdpi.com/2076-3417/15/13/7443)</sup><sup> • </sup><sup>[12](https://link.springer.com/article/10.1186/s12874-026-02887-0)</sup>。对所有由预测驱动的选择都适用一条警告：由交叉验证估计出的预测最优 \( \lambda \) 可能导致纳入许多假阳性<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>。

## 理论：套索何时有效

在 p > n 的稀疏情形下，当 \( \lambda \) 的量级为 \( \log(p)/n \) 时，套索在预测上是一致的<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup><sup> • </sup><sup>[3](https://stat.ethz.ch/education/semesters/ss2016/sparsity/sparsity-ETH.pdf)</sup>。一致的变量选择则更难。它需要 beta-min 假设，即活跃变量的系数满足 \( \min\{\|\beta_{0j}\|\} \gtrsim \sqrt{s_0 \log(p)/n} \)，还需要设计矩阵上的一个条件，称为不可表示条件<sup>[6](https://stat.ethz.ch/Manuscripts/buhlmann/EMS-surveys.pdf)</sup>。Zhao 与 Yu（2006）证明，仅此一个条件就足以使套索在线性回归中一致地用于模型选择，并证明它对高概率下的支撑集恢复是必要的；当 p 很大时，该条件相当严格<sup>[7](https://jmlr.org/papers/volume7/zhao06a/zhao06a.pdf)</sup><sup> • </sup><sup>[16](http://www.tracyke.net/papers/VScompare.pdf)</sup>。估计与预测的神谕结果已在限制特征值条件下建立，其中神谕性质指惩罚估计量渐近等价于一个事先知道真实支撑集的估计量<sup>[17](https://ar5iv.labs.arxiv.org/html/1603.06177)</sup>。

已知有两个结构性限制。第一，当 p > n 时，套索至多能选出 n 个变量，而在一项模拟研究中，95.24% 的真实模型包含多于 n 个协变量<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup><sup> • </sup><sup>[18](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0107957)</sup>。第二，Ji 与 Jin（2012）给出了套索 Hamming 错误率的下界，揭示其在变量选择上并非最优；套索的选择效果可能不尽如人意，尤其当设计矩阵的列之间存在中等或强相关时<sup>[16](http://www.tracyke.net/papers/VScompare.pdf)</sup>。

## 相关预测变量

当预测变量相关时，套索倾向于随机只选择其中一个，而不是一个都不选或全部选中<sup>[19](https://borowiecki.dev/pdf/2109.12006)</sup>。它对高相关并不稳健：可能从一组中任意选择一个而忽略其余，也可能无法同时选出两个完全相同的预测变量<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC3363152/)</sup>。相比之下，岭回归表现出分组效应，相关变量会得到相近的估计<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>。Zou 与 Hastie（2005）提出的弹性网结合了 L1 与 L2 正则化，在存在相关特征时平滑了套索的变量选择行为<sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup>。

## 变体与扩展

**自适应套索**（Zou 2006）将依赖数据的权重 \( w_j = 1/\|\hat{\beta}_j\|^{\gamma} \) 纳入惩罚项，对大系数收缩得比小系数少，以减少套索的偏倚；在此选择下它达到 \( \sqrt{n} \) 一致性与神谕性质<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup><sup> • </sup><sup>[12](https://link.springer.com/article/10.1186/s12874-026-02887-0)</sup>。

**弹性网**将惩罚项组合为 \( (1-\alpha)\|\beta\|_1 + \alpha\|\beta\|_2^2 \)，在套索的稀疏性与岭回归的分组效应之间权衡，且与套索不同，它在 p > n 情形下没有至多选 n 个变量的限制<sup>[19](https://borowiecki.dev/pdf/2109.12006)</sup><sup> • </sup><sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>。

**非凸惩罚。** SCAD（Fan 与 Li 2001）对大系数不加惩罚，对大系数几乎无偏，并在正则条件下具有神谕性质<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>。

**结构化惩罚。** 一族相关惩罚包括组套索、重叠组套索、分层组套索、双稀疏套索与融合套索<sup>[19](https://borowiecki.dev/pdf/2109.12006)</sup>。数据共享套索（Gross 与 Tibshirani 2016）以 glmnet 作为其优化后端，在相关数据集之间共享信息，这一做法接近多任务学习<sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup>。套索的思想具有一般性，可推广到广义回归模型与基于树的模型<sup>[1](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup>。

## 选择后推断

当把 t 检验等标准推断技术不加调整地用于套索选出的变量时，可能无效，并可能产生有偏的系数估计与膨胀的第一类错误率<sup>[11](https://www.arxiv.org/pdf/2604.03541)</sup>。套索造成的收缩偏倚破坏了渐近正态性，使基于 t 统计量的推断程序失效<sup>[20](https://arxiv.org/abs/2409.10030v3)</sup>。

主要有三种补救方法：样本分割，即在独立的数据划分上分离模型选择与推断；去偏（去稀疏化）套索，即施加基于投影的校正以缓解收缩偏倚；以及精确的选择后推断，即以选择事件为条件<sup>[12](https://link.springer.com/article/10.1186/s12874-026-02887-0)</sup>。去偏套索使高维 p > n 情形下的置信区间与 p 值成为可能，但仅在严格稀疏下数学上有效，即非零参数个数 \( s_0 \) 必须远小于 \( \sqrt{n}/\log(p) \)<sup>[11](https://www.arxiv.org/pdf/2604.03541)</sup>。Tibshirani 曾建议将 lasso 中的第二个 “s” 理解为 “screening”（筛选）而非 “selection”（选择），并用自适应套索或松弛套索等两阶段程序去除假阳性，而稳定性选择（Meinshausen 与 Bühlmann，2010）则控制第一类错误率<sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>。即便如此，自适应套索程序在线性回归的变量选择后推断中并不总能达到令人满意的覆盖性质，这一点仍存在分歧<sup>[12](https://link.springer.com/article/10.1186/s12874-026-02887-0)</sup>。

## 与其他方法的比较

关于预测的证据因情形而异。在一项大 p、小 n 情形下的大型模拟比较中，岭回归在 90.46% 的模拟中显示出比套索更小的均方误差<sup>[18](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0107957)</sup>。在一项 2025 年关于低维数据的研究中，套索在信息有限（小样本、高相关、低信噪比）时更优，但在信息充足的情形下效果较差，此时非负绞刑、自适应套索与松弛套索表现更好，且它们之间没有明显的胜者<sup>[15](https://www.mdpi.com/2076-3417/15/13/7443)</sup>。Tibshirani 自己的模拟表明，套索结合了子集选择与岭回归的优良性质<sup>[1](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup>。

## 软件与算法

1996 年的原始论文使用现成的二次规划求解器<sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>。LARS 算法（Efron 等，2002）给出了高效解法；它每步加入一个变量，从与响应最相关的变量开始<sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup><sup> • </sup><sup>[19](https://borowiecki.dev/pdf/2109.12006)</sup>。循环坐标下降（Friedman 等，2007，2010）计算整条套索解路径，且比 LARS 更快<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC3363152/)</sup><sup> • </sup><sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>。关键洞见在于，沿递减的 \( \lambda \) 序列使用热启动的循环坐标下降是有效的；路径从 \( \lambda_{\max} \) 开始，即整个系数向量为零的最小取值，而计算整条路径可能比在小的 \( \lambda \) 处求单个解更快<sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup><sup> • </sup><sup>[4](https://hastie.su.domains/Papers/glmnet.pdf)</sup>。

**glmnet** 自 2008 年起在 CRAN 上，使用坐标下降在 \( \lambda \) 网格上拟合套索或弹性网惩罚的正则化路径，可处理线性、逻辑、多项、泊松与 Cox 模型，包括非常大的稀疏数据矩阵<sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup><sup> • </sup><sup>[2](https://glmnet.stanford.edu/reference/glmnet.html)</sup>。1.6 版（2011 年 4 月）引入了强规则筛选，对稀疏问题可筛除绝大多数预测变量<sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup>。基准实践也使用 R 包 ncvreg、flare 与 c060，并以十折交叉验证调参<sup>[8](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)</sup>。scikit-learn 提供套索与弹性网拟合，但缺乏对融合、组或稀疏组套索等结构化惩罚的原生支持，也不为 Lasso 或 ElasticNet 提供 p 值、置信区间或选择后推断<sup>[11](https://www.arxiv.org/pdf/2604.03541)</sup>。

## 应用与规模

在高维基因组学中，仅约 10 到 1000 个个体就要测量数千到数十万个变量<sup>[6](https://stat.ethz.ch/Manuscripts/buhlmann/EMS-surveys.pdf)</sup>。全基因组关联研究规模更大：截至 2011 年，已完成 1,200 项针对 200 多种疾病的人类 GWAS，典型样本量为 10,000 到 50,000，约 \( 10^6 \) 个 SNP 标记<sup>[6](https://stat.ethz.ch/Manuscripts/buhlmann/EMS-surveys.pdf)</sup>。样本量对预测影响极大：一项分析约 600,000 个 SNP 的研究发现，在只有几百个个体时，SNP 效应被严重惩罚且预测很差，并得出结论：套索回归需要数千个个体才能取得良好预测<sup>[21](https://link.springer.com/article/10.1186/s12919-018-0149-2)</sup>。在规模顶端，SNPnet（Qian 等 2020）将套索应用于现代 GWAS 的规模，即数十万样本乘数十万变异<sup>[10](https://glmnet.stanford.edu/articles/glmnet-history.html)</sup>。在经济学中，IVX-去稀疏化套索被应用于 FRED-MD 数据上的美国股票收益与通胀可预测性研究<sup>[20](https://arxiv.org/abs/2409.10030v3)</sup>。

## 历史

套索是带 L1 范数惩罚的回归，而 L1 范数在 1996 年之前已存在很久。对 Tibshirani 影响最直接的是 Leo Breiman 的非负绞刑（Breiman，1995），他将其两个阶段合并为一个；同时期的相关工作包括 Frank 与 Friedman（1993）带惩罚 \( \lambda \sum_j \|\beta_j\|^{\gamma} \) 的桥回归，以及 Chen、Donoho 与 Saunders（1998）在信号处理中使用 L1 惩罚的基追踪<sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>。该论文于 1994 年 1 月收稿，1995 年 1 月修回<sup>[1](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)</sup>。

接受过程缓慢。Tibshirani 将其归因于 1996 年计算缓慢、直到 2002 年 LARS 之前算法都是黑箱且缺乏统计动机、稀疏优势未被充分认识、大规模数据问题罕见，以及 R 语言的缺席<sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>。坐标下降方法（Friedman 等，2007，2010）催生了 glmnet 包，而高维数据时代提供了套索为之而建的问题<sup>[13](https://tibshirani.su.domains/ftp/lasso-retro.pdf)</sup>。

## 近期发展

选择后推断已扩展到高斯线性模型之外：一个统一的参数规划框架如今为广义线性模型中基于套索的变量选择之后的回归系数进行推断，模拟显示它纠正了朴素的选择后推断<sup>[22](https://www3.stat.sinica.edu.tw/ss_newpaper/SS-2025-0194_na.pdf)</sup>。去稀疏化套索的变体不断出现；IVX-去稀疏化套索（XDlasso，2024）同时消除收缩偏倚与非平稳回归量带来的 Stambaugh 偏倚<sup>[20](https://arxiv.org/abs/2409.10030v3)</sup>。在经验方面，2025 年的低维模拟证据澄清了普通套索在何时仍然更可取，即在信息有限时，而当信息充足时则由自适应与松弛变体接管<sup>[15](https://www.mdpi.com/2076-3417/15/13/7443)</sup>。

## References

1. [Tibshirani, R. (1996). Regression Shrinkage and Selection via the Lasso. JRSS-B.](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1996.tb02080.x)
2. [glmnet function reference, Stanford](https://glmnet.stanford.edu/reference/glmnet.html)
3. [Bühlmann & van de Geer. Lecture notes on sparsity, ETH Zürich](https://stat.ethz.ch/education/semesters/ss2016/sparsity/sparsity-ETH.pdf)
4. [Friedman, Hastie & Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. JSS.](https://hastie.su.domains/Papers/glmnet.pdf)
5. [Hastie, Tibshirani & Wainwright. Statistical Learning with Sparsity](https://www.ime.unicamp.br/~dias/SLS.pdf)
6. [Bühlmann. High-dimensional statistics, with applications to GWAS](https://stat.ethz.ch/Manuscripts/buhlmann/EMS-surveys.pdf)
7. [Zhao & Yu (2006). On Model Selection Consistency of Lasso. JMLR.](https://jmlr.org/papers/volume7/zhao06a/zhao06a.pdf)
8. [High-dimensional regression in practice: an empirical study (DZNE)](https://pub.dzne.de/record/144991/files/DZNE-2020-00355.pdf)
9. [Genomic selection using regularized linear regression models. PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC3363152/)
10. [A History of glmnet, Stanford](https://glmnet.stanford.edu/articles/glmnet-history.html)
11. [Survey of inference after lasso selection. arXiv](https://www.arxiv.org/pdf/2604.03541)
12. [Statistical inference after variable selection in Cox models. BMC Medical Research Methodology](https://link.springer.com/article/10.1186/s12874-026-02887-0)
13. [Tibshirani. Retrospective on the lasso](https://tibshirani.su.domains/ftp/lasso-retro.pdf)
14. [Wasserman. Model Sparsity and Feature Selection, CMU lecture notes](https://www.stat.cmu.edu/~larry/=sml/sparsity.pdf)
15. [Evaluating Prediction Performance: A Simulation Study (2025). MDPI Applied Sciences](https://www.mdpi.com/2076-3417/15/13/7443)
16. [Comparison of Hamming errors of representative variable selection methods](http://www.tracyke.net/papers/VScompare.pdf)
17. [Constraints and Conditions: the Lasso Oracle-inequalities. arXiv mirror](https://ar5iv.labs.arxiv.org/html/1603.06177)
18. [Simulation Studies as Designed Experiments. PLOS One](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0107957)
19. [A comprehensive guideline for regularization-path variable selection](https://borowiecki.dev/pdf/2109.12006)
20. [LASSO Inference for High Dimensional Predictive Regressions (XDlasso). arXiv](https://arxiv.org/abs/2409.10030v3)
21. [Using penalized regression to predict phenotype from SNP data. BMC Proceedings](https://link.springer.com/article/10.1186/s12919-018-0149-2)
22. [Post-selection inference for GLMs after Lasso selection. Statistica Sinica preprint](https://www3.stat.sinica.edu.tw/ss_newpaper/SS-2025-0194_na.pdf)
23. [myweb.uiowa.edu](https://myweb.uiowa.edu/pbreheny/7240/s19/notes/2-13.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/lasso-statistics

English original: https://www.edgepedia.org/lasso-statistics
