Math ClubMath Club
v1 · padrão canônico

Lição 118 — Análise de Componentes Principais (PCA)

Hotelling 1933: diagonalizar a covariância para encontrar direções de máxima variância. Scores, variância explicada, scree plot. Conexão com SVD. Aplicação em ML, finanças, genômica.

Used in: 3.º ano do EM (17-18 anos) · Equiv. Stochastik LK alemão · Equiv. H2 Math Statistics singapurense · Equiv. Math B japonês avançado

Σ=VΛVT,zk=VkT(xxˉ)\Sigma = V \Lambda V^T, \quad z_k = V_k^T (x - \bar{x})
Choose your door

Rigorous notation, full derivation, hypotheses

数学定义

设置和样本协方差

"The covariance matrix Σ\Sigma is always symmetric and positive semidefinite. Its eigenvalues are nonnegative and the eigenvectors form an orthonormal basis of Rd\mathbb{R}^d." — Introduction to Applied Linear Algebra (VMLS), §10.1

主成分

最优性

"The principal components are the eigenvectors of the data covariance matrix, ordered by decreasing eigenvalue. The first principal component captures the maximum variance; successive components capture maximum residual variance subject to orthogonality." — Understanding Linear Algebra, §7.1

与 SVD 的联系

重构和近似误差

x^i=xˉ+k=1Kzikvk\hat{x}_i = \bar{x} + \sum_{k=1}^K z_{ik}\, v_k
what this means · 保留 K 个分量在所有秩 K 投影中最小化均方重构误差(Eckart-Young 应用于 PCA)。

重构误差:

已解决的例子

Exercise list

30 exercises · 7 with worked solution (25%)

Application 17Understanding 3Modeling 5Challenge 2Proof 3
  1. Ex. 118.1Understanding

    为什么在应用 PCA 前必须中心化数据(减去平均值)?

  2. Ex. 118.2Application

    给定 ,计算协方差和主成分。

  3. Ex. 118.3Application

    的特征值:。计算每个 PC 解释的方差和累积方差。累积方差达到 90% 时 是多少?

  4. Ex. 118.4Application

    二维数据集的 PC:。计算 在两个分量上的评分。

  5. Ex. 118.5Application

    使用前一个练习的数据,仅保留 PC1 重构 。重构误差是多少?

  6. Ex. 118.6UnderstandingAnswer key

    为什么通过数据矩阵 的 SVD 计算 PCA 比直接对 进行特征分解更优选?

  7. Ex. 118.7ApplicationAnswer key

    计算 的 PC。每个分量解释的方差是多少?

  8. Ex. 118.8ApplicationAnswer key

    用标准化数据(z-score),总方差是多少?Kaiser 准则仅保留特征值大于 1 的 PC 意味着什么?

  9. Ex. 118.9Application

    特征值为 (总共 10)的数据集。计算保留 K = 1 和 K = 2 个分量时的均方重构误差。

  10. Ex. 118.10Modeling

    10 只股票回报的 PCA 导致 PC1 对所有股票的负荷幅度相似且为正。PC1 在经济上代表什么?投资组合经理如何使用这个信息?

  11. Ex. 118.11ApplicationAnswer key

    个样本的 的 SVD 给出奇异值 。计算对应的协方差特征值和 PC1 解释的方差。

  12. Ex. 118.12UnderstandingAnswer key

    证明不同主成分的评分彼此不相关。

  13. Ex. 118.13Application

    数据集有 50 个标准化特征。用 K = 10 PC 捕获 95% 的方差,需要多少参数来通过秩 K 的 PCA 表示协方差与完整协方差相比?

  14. Ex. 118.14ModelingAnswer key

    解释巴西收益率曲线的 3 个第一 PC 代表什么。为什么这 3 个因素解释 ~99% 的方差?

  15. Ex. 118.15Application

    解释用和不用先前标准化(z-score)进行 PCA 的区别。你什么时候不应该标准化?

  16. Ex. 118.16Proof

    证明投影到 K 个第一 PC 中最小化所有秩 K 线性投影中的均方重构误差。以特征值表示最小误差值。

  17. Ex. 118.17Application

    按递减顺序的特征值:12、8、3、1、1、1、1、1。精神上构建碎石图并识别"肘"。保留多少个 PC 以达到 80% 的方差?

  18. Ex. 118.18Modeling

    描述使用 PCA 的 Eigenfaces 方法(Turk-Pentland 1991)进行面部识别。与原始像素相比实现了什么维度?

  19. Ex. 118.19Application

    PCA 和 ICA(独立分量分析)在概念上有什么区别?在什么类型的问题中 ICA 是必要的?

  20. Ex. 118.20Application

    当协方差矩阵是恒等式()时会发生什么?这对 PCA 和降维意味着什么?

  21. Ex. 118.21Proof

    证明对称矩阵对应于不同特征值的特征向量是正交的。用这个来证明 PC 的正交性。

  22. Ex. 118.22ModelingAnswer key

    解释 PCA 双图显示什么。如何解释特征箭头的方向和长度以及样本的位置?

  23. Ex. 118.23Application

    为什么经典 PCA 对异常值敏感?Robust PCA 用什么想法来处理这个问题?

  24. Ex. 118.24Application

    数据集:N = 1000 个样本,d = 100 个标准化特征。K = 5 PC 的 PCA 解释 80% 的方差。计算数据压缩因子(原始存储与 PCA 表示存储的比率)。

  25. Ex. 118.25Challenge

    解释核 PCA 的想法。用核替换内积如何允许捕获非线性结构?计算复杂度是多少?

  26. Ex. 118.26Application

    解释 PCA 的"对偶技巧":当 (特征多于样本)时,如何高效计算 PCA?每种情况下的复杂度是多少?

  27. Ex. 118.27Application

    ENEM 2023 微观数据的 PCA(5 个分数:CN、CH、LC、MT、作文)导致 PC1 对所有分数的负荷幅度相似且为正。解释 PC1。PC2 可能代表什么?

  28. Ex. 118.28Proof

    证明第 k 个评分 的样本方差等于协方差的第 k 个特征值 。使用与 SVD 的联系。

  29. Ex. 118.29Modeling

    在 1000 基因组项目中,来自 26 个群体的 ~2500 人的基因组数据的 PCA 显示按大陆的聚类。解释这如何可能,以及前 3 个 PC 在遗传上代表什么。

  30. Ex. 118.30Challenge

    描述概率 PCA 模型(Tipping-Bishop 1999)。相对于经典 PCA 有什么优点?该模型如何在某个极限情况下减少到经典 PCA?

来源

  • Understanding Linear Algebra — David Austin · Grand Valley State University · CC-BY-SA · 第 7 章:通过 SVD 的 PCA、解释的方差、碎石图、应用。
  • Introduction to Applied Linear Algebra (VMLS) — Stephen Boyd, Lieven Vandenberghe · Stanford University · CC-BY-NC-ND · 第 10 章:PCA 严格理论、最优性、SVD 联系、ML 应用。
  • OpenIntro Statistics — Diez, Çetinkaya-Rundel, Barr · CC-BY-SA · §8.3:统计观点、解释的方差、分量解释、真实数据练习。

Updated on 2026-05-06 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.