# 矩阵分解

矩阵分解（或称矩阵因子分解）是把一个矩阵表示为若干较简单矩阵的乘积，这些因子通常为三角、对角或正交因子，选取它们是为了使求解线性方程组、拟合最小二乘模型或求特征值等计算问题变得更容易、数值上更可靠。日常数值实践中使用的分解有LU分解（带主元）、乔莱斯基分解（Cholesky factorization）、QR分解及其变体，以及奇异值分解（SVD）；它们实现在LAPACK、SciPy和MATLAB等标准库中。<sup>[1](https://www.netlib.org/lapack/faq.html)</sup><sup> • </sup><sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup>

| 关键事实 | 细节 |
|---|---|
| LU分解 | 对一般矩阵，\( PA = LU \)，其中 \( P \) 为置换矩阵，\( L \) 为单位下三角矩阵，\( U \) 为上三角矩阵；用于求解方阵线性方程组，并且一旦算出分解，就能对许多右端项快速求解。<sup>[3](https://www.netlib.org/lapack/lug/node38.html)</sup><sup> • </sup><sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup> |
| 乔莱斯基分解 | 适用于埃尔米特正定矩阵，\( A = LL^{H} \) 或 \( A = U^{H}U \)；后向稳定，且在标准分解中运算量最少。<sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup><sup> • </sup><sup>[4](https://www.global-sci.com/ijnam/article/view/10227)</sup> |
| QR分解 | 适用于任意 \( m \times n \) 矩阵，\( A = QR \)，其中 \( Q \) 为正交（酉）矩阵，\( R \) 为上三角或上梯形矩阵；是求最小二乘解的标准稳定途径。<sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup><sup> • </sup><sup>[5](https://www.netlib.org/lapack/lug/node39.html)</sup> |
| SVD | 每个矩阵都可分解为 \( A = U\Sigma V^{H} \)；截断SVD给出Frobenius范数下的最优秩\( k \)逼近（埃卡特–扬定理）。<sup>[6](https://www.siam.org/media/gxjdgoex/sn_march_2026_print.pdf)</sup> |
| 速度比较 | 对于列满秩、条件数为低到中等的最小二乘方程组，乔莱斯基分解的平均计算时间为QR分解的二分之一到四分之一。<sup>[4](https://www.global-sci.com/ijnam/article/view/10227)</sup> |
| 精度比较 | 在一项对十一个超定方程组的比较中，在QR、SVD和LU三者中，SVD给出的最小二乘解最精确，而LU最快。<sup>[7](https://www.ukdr.uplb.edu.ph/etd-undergrad/9966/)</sup> |
| 软件支持 | LAPACK提供用于稠密矩阵和带状矩阵、实算术和复算术、单精度和双精度的LU、乔莱斯基、QR、SVD、舒尔及广义舒尔分解的例程。<sup>[1](https://www.netlib.org/lapack/faq.html)</sup> |

## 主要分解

**带主元的LU分解。** 对一般方阵方程组 \( Ax = b \)，先要把 \( A \) 分解为三角矩阵的乘积，然后求得解。LAPACK对一般矩阵的形式是 \( A = PLU \)，其中 \( P \) 为置换矩阵，\( L \) 为对角元全为1的下三角矩阵，\( U \) 为上三角矩阵。<sup>[3](https://www.netlib.org/lapack/lug/node38.html)</sup> 分解一旦存在，每个新的右端项都通过前代和回代处理，因此初始的分解开销换来了对同一矩阵的许多方程组快速求解。<sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup>

**乔莱斯基分解。** 当 \( A \) 为埃尔米特正定矩阵，即 \( A = A^{H} \)，且对所有 \( x \) 都有 \( x^{H}Ax \ge 0 \)，并且对每个非零 \( x \) 该不等式实际上严格成立时，可分解为 \( A = LL^{H} \) 或 \( A = U^{H}U \)，其中 \( L \) 为下三角矩阵，\( U = L^{H} \)。<sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup><sup> • </sup><sup>[24](https://www.cs.utexas.edu/~flame/laff/alaff/chapter05-hermitian-positive-definite-matrices.html)</sup> 乔莱斯基分解是利用对称性的LU分解特例，它后向稳定，并且在标准分解中运算量最少。<sup>[4](https://www.global-sci.com/ijnam/article/view/10227)</sup>

**QR分解及其相关分解。** QR分解适用于任意 \( m \times n \) 阵列，并求出 \( m \times m \) 的酉矩阵 \( Q \) 和 \( m \times n \) 的上梯形矩阵 \( R \)，使 \( A = QR \)。<sup>[2](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)</sup> 相关分解覆盖其他形状和用途：LQ分解 \( A = (L \; 0)Q \) 本质上是 \( A^{T} \) 的QR分解，给出欠定方程组的最小范数解；QL和RQ分解由LAPACK例程xGEQLF和xGERQF计算，较少使用；带列主元的QR分解 \( A = Q \left( \begin{smallmatrix} R \\ 0 \end{smallmatrix} \right) P^{T} \) 用于 \( A \) 的秩存疑时。<sup>[8](https://www.netlib.org/lapack/lug/node41.html)</sup><sup> • </sup><sup>[9](https://www.netlib.org/lapack/lug/node44.html)</sup><sup> • </sup><sup>[10](https://www.netlib.org/lapack/lug/node42.html)</sup> 从右侧再施加正交变换，得到完全正交分解 \( AP = Q \left( \begin{smallmatrix} T_{11} & 0 \\ 0 & 0 \end{smallmatrix} \right) Z^{T} \)，由此可得到秩亏最小二乘问题的最小范数解。<sup>[11](https://www.netlib.org/lapack/lug/node43.html)</sup>

**SVD。** 奇异值分解把任意实或复、方或矩形矩阵分解为 \( A = U\Sigma V^{H} \)，其中 \( \Sigma \) 为对角矩阵，对角元为非负奇异值。由于奇异值有序，截断该展开就得到自然的低秩压缩；埃卡特–扬定理指出，这种截断SVD \( A_k \) 是Frobenius范数下对秩为 \( r \) 的矩阵 \( A \) 的最优秩\( k \)（或更低秩）逼近。<sup>[6](https://www.siam.org/media/gxjdgoex/sn_march_2026_print.pdf)</sup>

## 分解的用途

每种分解针对一类问题。LU和乔莱斯基分解求解方阵线性方程组；QR分解求解线性最小二乘问题，并作为特征值和奇异值计算中的预备步骤；SVD求解秩亏最小二乘问题，判定数值秩，并支撑低秩逼近。<sup>[3](https://www.netlib.org/lapack/lug/node38.html)</sup><sup> • </sup><sup>[5](https://www.netlib.org/lapack/lug/node39.html)</sup><sup> • </sup><sup>[10](https://www.netlib.org/lapack/lug/node42.html)</sup>

在统计学中，SVD是获得主成分的一种数值上可靠的方法。MATLAB的`pca`函数提供三种算法：数据矩阵的SVD（默认）、协方差矩阵的特征值分解，以及交替最小二乘。当观测数超过变量数时，特征值路线比SVD更快，但精度较低，因为协方差矩阵的条件数是数据矩阵条件数的平方。<sup>[12](https://www.mathworks.com/help/stats/pca.html)</sup> 同样的平方风险解释了为什么在一般最小二乘工作中，先形成正规方程再分解的做法会受到谨慎对待。

现代库把分解暴露为可复用对象。MATLAB的`decomposition`一次性创建LU、LDL、乔莱斯基、QR及其他分解，并在重复求解时复用它们；其`'qr'`和`'cod'`类型分别返回最小二乘解和最小范数最小二乘解。<sup>[13](https://www.mathworks.com/help/matlab/ref/decomposition.html)</sup> SciPy提供建立在LAPACK之上的对应例程（`lu`、`cholesky`、`qr`、`svd`，以及`qr_insert`和`qr_delete`等更新与降更新变体）。<sup>[14](https://docs.scipy.org/doc/scipy/reference/linalg.html)</sup>

## 精度、稳定性与选择方法

分解之间的选择由矩阵结构、条件性和开销决定。正交矩阵是稳定性的关键：实正交矩阵 \( Q \) 满足 \( Q^{T}Q = I \)，保持每个向量的二范数不变，因此不会在分解过程中放大舍入误差。<sup>[5](https://www.netlib.org/lapack/lug/node39.html)</sup>

**乔莱斯基分解与QR分解。** 尽管若干作者曾建议用QR分解而不是正规方程路线，但一项对稠密列满秩最小二乘问题的概率分析发现：对于低到中等条件数，乔莱斯基解和QR解对随机参数扰动的敏感性在机器精度范围内没有显著差异；对于条件数被人为设得很高的矩阵，两种解的相对差异平均仅为 \(10^{-6}\) 量级。乔莱斯基分解明显更快：QR的平均计算时间是它的二到四倍，而乔莱斯基分解时间的标准差约为QR的三分之一。作者得出结论：对此类方程组，采用乔莱斯基分解的正规方程方法优于QR。<sup>[4](https://www.global-sci.com/ijnam/article/view/10227)</sup>

**SVD作为精度基准。** 在一项1991年的本科研究中，对十一个超定方程组比较QR、SVD和LU最小二乘求解器，其中三个矩阵是奇异的；SVD和LU仍返回近似最小二乘解，SVD被评为三者中最精确，LU最快。<sup>[7](https://www.ukdr.uplb.edu.ph/etd-undergrad/9966/)</sup> 这种模式很常见：SVD以更高代价换取在病态或秩亏问题上的稳健性，而三角分解则在良态问题上具有速度优势。

**混合与随机变体。** 乔莱斯基-QR通过Gram矩阵的乔莱斯基分解来计算QR分解，在GPU上对于高瘦矩阵属于最快的QR算法之一，但数值上不稳定：形成Gram矩阵会使条件数平方，当 \( \kappa_2(A) \gtrsim 10^{8} \) 时导致失效。2025年的一种混合精度随机预条件方案（MRCQR）在双精度下应用乔莱斯基-QR之前，将有效条件数降到接近1，对高达 \(10^{16}\) 的条件数仍保持稳定，并在NVIDIA H100上比cuSOLVER的豪斯霍尔德QR例程geqrf快1.8到13.5倍。<sup>[15](https://arxiv.org/abs/2606.18411)</sup>

## 历史

三角分解源于高斯消元法，这种方法在古代中国和近代早期欧洲各自独立产生。其矩阵解释到20世纪30年代末才出现：波兰天文学家、大地测量学家和数学家塔德乌什·巴纳希维奇（Tadeusz Banachiewicz）是最早以矩阵分解形式表述高斯消元法的作者之一（1937年至1938年），统计学家保罗·S. 德怀尔（Paul S. Dwyer）在1944年证明，杜利特尔计算法构造出的三角矩阵之积重现了消元过程；他从向量外积之和导出该分解，并为正规方程发展了一种“平方根”方法，对应现代乔莱斯基方法。<sup>[16](https://doi.org/10.1016/j.hm.2010.06.003)</sup> 一旦消元被解读为分解，各种手工计算方案便被统一起来：一种形式体系就足以涵盖它们全部。<sup>[16](https://doi.org/10.1016/j.hm.2010.06.003)</sup>

正交分解出现得更晚。阿尔斯通·豪斯霍尔德（Alston Householder）1958年的论文通过一系列反射直接消去对角线以下的元素，给出了QR分解的一条数值稳定路线，且不需要再正交化步骤。<sup>[17](https://cpoli.github.io/mathematicskit/history/linalg_breakthroughs.html)</sup> SVD本身由贝尔特拉米（Beltrami）、若尔当（Jordan）和西尔维斯特（Sylvester）在19世纪末发现，但直到吉恩·戈卢布（Gene Golub）和威廉·卡汉（William Kahan）于1965年发表基于归约的稳定算法，并由戈卢布和克里斯蒂安·赖因施（Christian Reinsch）在1969年加以完善之后，它才成为实用工具。<sup>[18](https://math.ecnu.edu.cn/~jypan/Teaching/MC/refs/NAessay2008.pdf)</sup><sup> • </sup><sup>[19](https://www.mathworks.com/company/technical-articles/variants-of-the-qr-algorithm.html)</sup> 奇异值一词“valeurs singulières”最早由埃米尔·皮卡（Émile Picard）约在1910年结合积分方程使用。<sup>[20](https://www.mathworks.com/company/technical-articles/professor-svd.html)</sup>

## 低秩逼近与随机方法

对非常大的矩阵，计算精确SVD代价高昂：经典方法所需的存储和时间相对于矩阵维数是超线性的，这对大型数据集而言难以承受。随机算法解决了这一问题。对矩阵的列和行进行采样的蒙特卡洛算法，能在目标秩和精度参数的多项式时间内计算出具有可证明误差界的低秩逼近，某些变体的计算时间甚至与矩阵维数无关。<sup>[21](https://epubs.siam.org/doi/10.1137/S0097539704442696)</sup> 用于主成分分析的随机方法产生的低秩逼近，其精度对于任意大小的矩阵都非常接近可能达到的最佳值。<sup>[22](https://epubs.siam.org/doi/10.1137/080736417)</sup> 基于草图的算法扩展了这种方法，从矩阵的随机线性像（或称草图）构造低秩逼近，同时保持半正定性等结构性质。<sup>[23](https://epubs.siam.org/doi/10.1137/17M1111590)</sup> 这些方法把经典分解当作构件：随机草图缩小问题规模，然后在较小的矩阵上计算QR分解或SVD。

## References

1. [LAPACK FAQ, Netlib](https://www.netlib.org/lapack/faq.html)
2. [Linear Algebra (scipy.linalg) tutorial, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/tutorial/linalg.html)
3. [Linear Equations, LAPACK Users' Guide](https://www.netlib.org/lapack/lug/node38.html)
4. [QR Versus Cholesky: A Probabilistic Analysis, International Journal of Numerical Analysis and Modeling](https://www.global-sci.com/ijnam/article/view/10227)
5. [Orthogonal Factorizations and Linear Least Squares Problems, LAPACK Users' Guide](https://www.netlib.org/lapack/lug/node39.html)
6. [The ordering of singular values and the Eckart-Young theorem, SIAM News, March 2026](https://www.siam.org/media/gxjdgoex/sn_march_2026_print.pdf)
7. [Marites G. Magistrado (1991), A comparison of least-squares solutions to overdetermined linear systems, UPLB Undergraduate Theses](https://www.ukdr.uplb.edu.ph/etd-undergrad/9966)
8. [LQ Factorization, LAPACK Users' Guide](https://www.netlib.org/lapack/lug/node41.html)
9. [Other Factorizations, LAPACK Users' Guide](https://www.netlib.org/lapack/lug/node44.html)
10. [QR Factorization with Column Pivoting, LAPACK Users' Guide](https://www.netlib.org/lapack/lug/node42.html)
11. [Complete Orthogonal Factorization, LAPACK Users' Guide](https://www.netlib.org/lapack/lug/node43.html)
12. [pca — Principal component analysis of raw data, MATLAB documentation](https://www.mathworks.com/help/stats/pca.html)
13. [decomposition — Matrix decomposition for solving linear systems, MATLAB documentation](https://www.mathworks.com/help/matlab/ref/decomposition.html)
14. [Linear algebra (scipy.linalg) reference, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/linalg.html)
15. [Numerically Stable Cholesky-QR on GPU via Mixed-Precision Randomized Preconditioning, arXiv:2606.18411](https://arxiv.org/abs/2606.18411)
16. [How ordinary elimination became Gaussian elimination, Historia Mathematica](https://doi.org/10.1016/j.hm.2010.06.003)
17. [Breakthroughs in Numerical Linear Algebra, mathematicskit documentation](https://cpoli.github.io/mathematicskit/history/linalg_breakthroughs.html)
18. [The SVD in numerical analysis (essay noting Beltrami, Jordan, Sylvester), Numerical Analysis 2000 essay collection](https://math.ecnu.edu.cn/~jypan/Teaching/MC/refs/NAessay2008.pdf)
19. [Variants of the QR Algorithm, MathWorks](https://www.mathworks.com/company/technical-articles/variants-of-the-qr-algorithm.html)
20. [Professor SVD, MathWorks](https://www.mathworks.com/company/technical-articles/professor-svd.html)
21. [P. Drineas, R. Kannan, M. W. Mahoney, Fast Monte Carlo Algorithms for Matrices II, SIAM Journal on Computing](https://epubs.siam.org/doi/10.1137/S0097539704442696)
22. [V. Rokhlin, A. Szlam, M. Tygert, A Randomized Algorithm for Principal Component Analysis, SIAM J. Matrix Anal. Appl.](https://epubs.siam.org/doi/10.1137/080736417)
23. [J. A. Tropp and colleagues, Practical Sketching Algorithms for Low-Rank Matrix Approximation, SIAM J. Matrix Anal. Appl.](https://epubs.siam.org/doi/10.1137/17M1111590)
24. [ALAFF Hermitian Positive Definite matrices](https://www.cs.utexas.edu/~flame/laff/alaff/chapter05-hermitian-positive-definite-matrices.html)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Numerical linear algebra › Matrix decompositions and factorizations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/matrix-decomposition

English original: https://www.edgepedia.org/matrix-decomposition
