# 主成分回归

主成分回归（PCR）是一种两步回归方法：先对预测变量应用主成分分析（PCA），再让响应变量对由此得到的成分得分回归，而不是对原始预测变量回归。它用于在线性建模中降维并缓解多重共线性，尤其在预测变量众多或高度相关时。

| 关键事实 | 详情 |
|---|---|
| 回归的对象 | 响应变量对主成分得分 \( Z = X V_{k} \) 回归，而不是对原始预测变量回归。<sup>[1](https://rich-d-wilkinson.github.io/MATH3030/2.2-principal-component-regression-pcr.html)</sup> |
| 等价视角 | PCR 是先做硬奇异值阈值化，再做普通最小二乘。<sup>[2](https://jmlr.org/papers/volume26/23-0102/23-0102.pdf)</sup> |
| 偏差控制 | 保留成分数 \( k \) 控制偏差；\( k = \operatorname{rank}(X) \) 时精确恢复 OLS。<sup>[1](https://rich-d-wilkinson.github.io/MATH3030/2.2-principal-component-regression-pcr.html)</sup> |
| 多重共线性 | 由于得分互不相关，最小二乘步骤稳定，方差膨胀因子可降至 1。<sup>[3](https://repository.lppm.unila.ac.id/8636/2/10.5923.j.statistics.20180804.02%20%281%29.pdf)</sup> |
| 主要弱点 | 成分的构造不使用响应，因此低方差但具有预测力的方向可能被丢弃。<sup>[4](https://scikit-learn.org/stable/auto_examples/cross_decomposition/plot_pcr_vs_pls.html)</sup> |
| 选择 \( k \) | 以 RMSEP 汇总的交叉验证是标准方法；碎石图和阈值规则也可使用。<sup>[5](http://www2.imm.dtu.dk/courses/27411/eNotepdfs/eNote4-PCRinR.pdf)</sup> |
| 软件 | R：`pls::pcr`；Python：由 `StandardScaler`、`PCA` 和 `LinearRegression` 组成的 scikit-learn `Pipeline` <sup>[5](http://www2.imm.dtu.dk/courses/27411/eNotepdfs/eNote4-PCRinR.pdf)</sup>,.<sup>[4](https://scikit-learn.org/stable/auto_examples/cross_decomposition/plot_pcr_vs_pls.html)</sup> |

## 工作原理

设 \( X \) 为中心化（通常还经过标准化）的预测变量矩阵，其奇异值分解为 \( X = U \Sigma V^{\top} \)。PCR 将响应 \( y \) 对前 \( k \) 个主成分得分 \( Z = X V_{k} = U_{k} \Sigma_{k} \) 回归，其中 \( V_{k} \) 包含前 \( k \) 个右奇异向量。<sup>[1](https://rich-d-wilkinson.github.io/MATH3030/2.2-principal-component-regression-pcr.html)</sup> 得分空间中的回归是普通最小二乘，\( b = (Z^{\top} Z)^{-1} Z^{\top} y \)，而原始变量中的回变换系数向量为

\[ \hat{\beta}^{\mathrm{pcr}} = V_{k} \Sigma_{k}^{-1} U_{k}^{\top} y \]

这不需要 \( X^{\top} X \) 可逆。<sup>[1](https://rich-d-wilkinson.github.io/MATH3030/2.2-principal-component-regression-pcr.html)</sup> 这就是为什么 PCR 能处理共线甚至 \( p > n \) 的数据，而普通最小二乘在这些情形下会失败：得分彼此不相关，因此每个保留成分的系数不受还纳入了哪些其他成分的影响 <sup>[6](https://allmodelsarewrong.github.io/pcr.html)</sup>，并且只需要 \( N > A \) 个观测，而不是 \( N > K \) 个预测变量。<sup>[7](https://learnche.org/pid/latent-variable-modelling/principal-components-regression)</sup>

该方法等价于先做硬奇异值阈值化，再做 OLS。<sup>[2](https://jmlr.org/papers/volume26/23-0102/23-0102.pdf)</sup> 丢弃最后 \( p - k \) 个成分会引入偏差，但会移除高方差、病态的方向；\( k \) 控制这一权衡，而 \( k = \operatorname{rank}(X) \) 给出无偏的 OLS 解 <sup>[8](https://www.stat.cmu.edu/technometrics/90-00/vol-35-02/v3502109.pdf)</sup>,.<sup>[1](https://rich-d-wilkinson.github.io/MATH3030/2.2-principal-component-regression-pcr.html)</sup>

## 实施步骤

实践者的工作流程按以下顺序进行：

1. **标准化预测变量。** 在 PCA 前标准化是推荐的良好实践；未标准化且单位量级大的变量可能主导载荷。<sup>[4](https://scikit-learn.org/stable/auto_examples/cross_decomposition/plot_pcr_vs_pls.html)</sup>
2. **对 \( X \) 运行 PCA**，按解释方差依次计算成分（NIPALS 算法是这方面最常用的算法之一）。<sup>[9](https://fabi.research.vub.be/sites/default/files/2021-07/PCR.pdf)</sup>
3. **通过交叉验证选择成分数 \( k \)**，以预测均方根误差（RMSEP）汇总；碎石图式检查和通用阈值化是有文献记载的替代方法 <sup>[5](http://www2.imm.dtu.dk/courses/27411/eNotepdfs/eNote4-PCRinR.pdf)</sup>,.<sup>[2](https://jmlr.org/papers/volume26/23-0102/23-0102.pdf)</sup> 不存在解析最优值；\( k \) 是一个调优参数，在 \( 1, \ldots, \operatorname{rank}(X) \) 上搜索。<sup>[6](https://allmodelsarewrong.github.io/pcr.html)</sup>
4. **用多元线性回归将 \( y \) 对 \( k \) 个得分回归。**<sup>[9](https://fabi.research.vub.be/sites/default/files/2021-07/PCR.pdf)</sup>
5. **验证。** 划分为训练集和测试集，在训练数据上交叉验证，并用平方预测误差（SPE）和霍特林 \( T^{2} \) 检查新观测；对超过这些限值的点，尤其是超过 SPE 限值的点，其预测不可信。<sup>[7](https://learnche.org/pid/latent-variable-modelling/principal-components-regression)</sup>

在 R 中，`pls` 包的 `pcr` 函数直接实现这一方法，例如 `pcr(logmpg ~ X, ncomp = 10, validation = "LOO", scale = TRUE, jackknife = TRUE)`。<sup>[5](http://www2.imm.dtu.dk/courses/27411/eNotepdfs/eNote4-PCRinR.pdf)</sup> 在 Python 中，PCR 是由 `StandardScaler`、`PCA` 和 `LinearRegression` 组成的 scikit-learn `Pipeline`；PCA 步骤完全无监督，不使用目标信息。<sup>[4](https://scikit-learn.org/stable/auto_examples/cross_decomposition/plot_pcr_vs_pls.html)</sup>

## 起源

主成分回归作为一种有名称的回归方法，归功于威廉·F·马西（William F. Massy）1965 年发表在《美国统计协会杂志》上的论文《探索性统计研究中的主成分回归》 <sup>[10](https://doi.org/10.1080/01621459.1965.10480787)</sup>,.<sup>[11](https://onlinelibrary.wiley.com/doi/10.1155/2014/639070)</sup> 其他可靠来源将这一传统追溯到如下建议：在多元回归中用主成分替换原始解释变量 <sup>[12](https://doi.org/10.1111/j.2044-8317.1957.tb00179.x)</sup>,.<sup>[13](http://www.npg.nature.com/articles/s41437-018-0078-x.pdf)</sup><sup> • </sup><sup>[14](https://scholarship.claremont.edu/cgi/viewcontent.cgi?article=1490&context=pomona_fac_pub)</sup>,.<sup>[15](https://doi.org/10.1037/h0071325)</sup> 该方法随后在化学计量学时代与偏最小二乘一同发展；PLS 本身由赫尔曼·沃尔德（Herman Wold）1975 年的 NIPALS 论文引入。<sup>[16](https://doi.org/10.1017/s0021900200047604)</sup>

## 变体

若干变体注入响应信息或软化硬性方差截断：

- **监督主成分**（贝尔、哈斯蒂、保罗与蒂布希拉尼，Bair、Hastie、Paul 与 Tibshirani，2006）在计算成分之前，先筛选出与结局的单变量关联超过阈值的预测变量，阈值由交叉验证确定；与标准 PCR 不同，它随着样本量和特征数增长具有一致性 <sup>[17](https://doi.org/10.1198/016214505000000628)</sup>,.<sup>[18](https://tibshirani.su.domains/ftp/spca.pdf)</sup>
- **相关主成分回归**（孙建国，Jianguo Sun，1995）按成分对预测响应的重要性而非方差来选择成分；在两个近红外示例中，它以更少的成分在预测能力上匹配 PCR 和 PLS。<sup>[19](https://doi.org/10.1002/cem.1180090104)</sup>
- **稀疏主成分回归**将最小二乘损失与 PCA 损失结合，并用 \( L_{1} \) 正则化获得稀疏载荷和自动成分选择 <sup>[20](https://ar5iv.labs.arxiv.org/html/1402.6455)</sup>；基于 SVD 的单阶段版本（SPCRsvd）由 ADMM 类算法估计。<sup>[21](https://link.springer.com/article/10.1007/s11634-020-00435-2)</sup>
- **校准主成分回归**（吴、朱、曹与石，Wu、Zhu、Cao 与 Shi，2025）在主成分子空间中学习低方差先验，并通过中心化吉洪诺夫步骤在原始特征空间中校准，使用样本拆分和交叉拟合来软化硬性谱截断。<sup>[22](https://arxiv.org/pdf/2510.19020)</sup>

## 应用

在预测变量多、高度相关或数量超过观测数的情形中，PCR 是标准做法。在化学计量学中，近红外（NIR）光谱校准是经典场景：一个小麦示例有 39 个样本和 68 个波长，用三个主成分对蛋白质进行回归，\( R^{2} = 0.9699 \)，残差标准误为 0.3274 <sup>[23](https://imae.udg.edu/~jpalarea/StatsDS/regression-analysis-with-many-variables.html)</sup>，奈斯与马滕斯（Næs and Martens）1988 年的论文提出了近红外分析中的成分选择。<sup>[24](https://doi.org/10.1002/cem.1180020207)</sup> 在基因组学中，PCR 和 PLSR 为基因组选择提供降维。<sup>[13](http://www.npg.nature.com/articles/s41437-018-0078-x.pdf)</sup> 监督主成分的提出受到 DNA 微阵列癌症数据的推动，在这些数据中预测变量远多于观测。<sup>[18](https://tibshirani.su.domains/ftp/spca.pdf)</sup> PCR 也广泛用于生物信息学和心理学 <sup>[21](https://link.springer.com/article/10.1007/s11634-020-00435-2)</sup>，并在宏观经济预测中很受欢迎。<sup>[25](https://arxiv.org/html/2409.03606)</sup>

## 局限与替代方法

**响应盲成分。** PCR 的特征向量权重只取决于预测变量之间的相关性，而不取决于响应。<sup>[14](https://scholarship.claremont.edu/cgi/viewcontent.cgi?article=1490&context=pomona_fac_pub)</sup> 哈迪与林（Hadi and Ling，1998）通过理论和例子表明，PCR 可能丢弃一个与响应完全相关的成分，却保留与响应完全不相关的成分。<sup>[14](https://scholarship.claremont.edu/cgi/viewcontent.cgi?article=1490&context=pomona_fac_pub)</sup> 一个 scikit-learn 玩具示例具体说明了代价：当目标与一个低方差方向相关时，使用一个成分的 PCR 在测试集上得分为 \( R^{2} = -0.026 \)，而使用一个成分的 PLS 得分为 0.658。<sup>[4](https://scikit-learn.org/stable/auto_examples/cross_decomposition/plot_pcr_vs_pls.html)</sup>

**未标准化变量。** 若不标准化，噪声变量可能主导前几个成分的载荷并掩盖信号。<sup>[26](https://github.com/WinVector/Examples/blob/master/PCR/XonlyPCA.md)</sup>

**\( k \) 选择不当。** 模拟显示，当 \( k \) 超过真实秩 \( r \) 时 PCR 预测良好，但当 \( k < r \) 时显著变差，提示实践者应偏向纳入更多成分。<sup>[2](https://jmlr.org/papers/volume26/23-0102/23-0102.pdf)</sup>

**比较。** PCR 对低方差方向施加尖锐阈值惩罚，岭回归施加平滑单调惩罚，PLS 施加平滑但非单调的惩罚。<sup>[8](https://www.stat.cmu.edu/technometrics/90-00/vol-35-02/v3502109.pdf)</sup> PLS 同时使用 \( y \) 和 \( X \) 构建成分，而 PCR 只使用 \( X \)；PCR 模型通常比相应的 PLS 模型多需要一个、有时两个成分 <sup>[23](https://imae.udg.edu/~jpalarea/StatsDS/regression-analysis-with-many-variables.html)</sup>；在一项化学计量学比较中，PLS 用约五到六个成分达到 OLS 解，而 PCR 需要全部十个成分。<sup>[8](https://www.stat.cmu.edu/technometrics/90-00/vol-35-02/v3502109.pdf)</sup> 与岭回归相比，已发表的比较结论不一致：在各向同性协变量下，最优调优的岭回归严格优于 PCR <sup>[27](https://arxiv.org/html/2405.11676v1)</sup>，弗兰克与弗里德曼（Frank and Friedman）1993 年的比较发现，岭回归在实践中往往给出更准确的预测 <sup>[28](https://arxiv.org/pdf/2501.11791)</sup>；然而在第一个尖峰很大的尖峰协方差模型下，PCR 的预测风险低于最优调优的岭回归 <sup>[27](https://arxiv.org/html/2405.11676v1)</sup>，在一项存在严重多重共线性（\( \rho = 0.99 \)）的蒙特卡洛研究中，在 OLS、LASSO、岭回归和 PCR 中，PCR 的平均均方误差最低。<sup>[3](https://repository.lppm.unila.ac.id/8636/2/10.5923.j.statistics.20180804.02%20%281%29.pdf)</sup> 贝耶与帕克（Baye and Parker，1984）的 \( r \)-\( k \) 类估计量将 PCR、岭回归和 OLS 作为特例包含在内。<sup>[29](https://doi.org/10.1080/03610928408828675)</sup> 其他替代方法包括考虑 \( y \) 的 PCA、变量剪枝、\( L_{2} \) 正则化回归和监督 PCR。

## References

1. [2.2 Principal component regression (PCR) | Multivariate Statistics](https://rich-d-wilkinson.github.io/MATH3030/2.2-principal-component-regression-pcr.html)
2. [On Model Identification and Out-of-Sample Prediction of PCR with Applications to Synthetic Controls (JMLR vol. 26)](https://jmlr.org/papers/volume26/23-0102/23-0102.pdf)
3. [Multicollinearity, LASSO, Ridge Regression, Principal Component Regression (simulation study)](https://repository.lppm.unila.ac.id/8636/2/10.5923.j.statistics.20180804.02%20%281%29.pdf)
4. [Principal Component Regression vs Partial Least Squares Regression, scikit-learn documentation](https://scikit-learn.org/stable/auto_examples/cross_decomposition/plot_pcr_vs_pls.html)
5. [PCR, Principal Component Regression in R (eNote 4, DTU course 27411)](http://www2.imm.dtu.dk/courses/27411/eNotepdfs/eNote4-PCRinR.pdf)
6. [15 Principal Components Regression | All Models Are Wrong](https://allmodelsarewrong.github.io/pcr.html)
7. [6.6. Principal Component Regression (PCR), Process Improvement using Data](https://learnche.org/pid/latent-variable-modelling/principal-components-regression)
8. [A Statistical View of Some Chemometrics Regression Tools (Frank & Friedman, Technometrics 1993)](https://www.stat.cmu.edu/technometrics/90-00/vol-35-02/v3502109.pdf)
9. [A tutorial on Principal Component Regression in chemometrics (VUB)](https://fabi.research.vub.be/sites/default/files/2021-07/PCR.pdf)
10. [William F. Massy (1965). Principal Components Regression in Exploratory Statistical Research. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1965.10480787)
11. [Two Classes of Almost Unbiased Type Principal Component Estimators in Linear Regression Model](https://onlinelibrary.wiley.com/doi/10.1155/2014/639070)
12. [Harold Hotelling (1957). THE RELATIONS OF THE NEWER MULTIVARIATE STATISTICAL METHODS TO FACTOR ANALYSIS. British Journal of Statistical Psychology.](https://doi.org/10.1111/j.2044-8317.1957.tb00179.x)
13. [PCR vs PLSR in genomic selection (Heredity, 2018)](http://www.npg.nature.com/articles/s41437-018-0078-x.pdf)
14. [The Principal Problem with Principal Components Regression (Jensen, Ramirez et al.)](https://scholarship.claremont.edu/cgi/viewcontent.cgi?article=1490&context=pomona_fac_pub)
15. [H. Hotelling (1933). Analysis of a complex of statistical variables into principal components.. Journal of Educational Psychology.](https://doi.org/10.1037/h0071325)
16. [Herman Wold (1975). Soft Modelling by Latent Variables: The Non-Linear Iterative Partial Least Squares (NIPALS) Approach. Journal of Applied Probability.](https://doi.org/10.1017/s0021900200047604)
17. [Eric Bair and colleagues (2006). Prediction by Supervised Principal Components. Journal of the American Statistical Association.](https://doi.org/10.1198/016214505000000628)
18. [Prediction by supervised principal components (Bair, Hastie, Tibshirani, Paul, Tibshirani)](https://tibshirani.su.domains/ftp/spca.pdf)
19. [Jianguo Sun (1995). A correlation principal component regression analysis of NIR data. Journal of Chemometrics.](https://doi.org/10.1002/cem.1180090104)
20. [Sparse principal component regression (SPCR) via convex optimization](https://ar5iv.labs.arxiv.org/html/1402.6455)
21. [Sparse principal component regression via singular value decomposition approach (SPCRsvd)](https://link.springer.com/article/10.1007/s11634-020-00435-2)
22. [Calibrated Principal Component Regression (CPCR)](https://arxiv.org/pdf/2510.19020)
23. [Chapter 12 Regression analysis with many variables | Statistics for Data Science (using R)](https://imae.udg.edu/~jpalarea/StatsDS/regression-analysis-with-many-variables.html)
24. [Tormod Næs, Harald Martens (1988). Principal component regression in NIR analysis: Viewpoints, background details and selection of components. Journal of Chemometrics.](https://doi.org/10.1002/cem.1180020207)
25. [Performance of Empirical Risk Minimization For Principal Component Regression](https://arxiv.org/html/2409.03606)
26. [PCR/XonlyPCA.md, WinVector/Examples (x-only PCA pitfalls)](https://github.com/WinVector/Examples/blob/master/PCR/XonlyPCA.md)
27. [The High-Dimensional Asymptotics of Principal Component Regression (2024)](https://arxiv.org/html/2405.11676v1)
28. [Envelope-guided Regularization (EgReg)](https://arxiv.org/pdf/2501.11791)
29. [Michael R. Baye, Darrell F. Parker (1984). Combining ridge and principal component regression:a money demand illustration. Communication in Statistics- Theory and Methods.](https://doi.org/10.1080/03610928408828675)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles Mo to W

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/principal-component-regression

English original: https://www.edgepedia.org/principal-component-regression
