线性代数 / Linear Algebra
矩阵代数
Matrix Algebra
本页结构
核心概念
- 非奇异、正交、幂等和半正定矩阵 Nonsingular, orthogonal, idempotent and positive semidefinite matrices
- 二维旋转和几何解释 2D rotations and geometric interpretation
- 二次型与协方差矩阵直觉 Quadratic forms and covariance-matrix intuition
学习顺序
- 把代数定义和几何含义对应起来。 Link algebraic definitions to geometric meaning.
- 讨论协方差矩阵时强调对称性和半正定性。 For covariance matrices, emphasize symmetry and positive semidefiniteness.
- 用低维例子快速校验结论。 Use small-dimensional examples to sanity-check claims.
基础知识
Fundamental Knowledge
Let and be square matrices. Then all of the following hold:
令 和 为 方阵。那么以下所有条件都成立:
非奇异矩阵
Nonsingular Matrices
A nonsingular matrix is invertible. () is nonsingular if and only if any (and therefore all) of the following hold:
非奇异矩阵是可逆的。 () 是非奇异的当且仅当以下任何一个(因此全部)成立:
- Columns of span , or equivalently,
- is nonsingular
- has only the trivial solution ;
- 的列跨越 ,或等效地,
- is nonsingular
- has only the trivial solution ;
Note that if , then . Larger inverses may be found via Gauss-Jordan Elimination:
请注意,如果 ,则 。更大的逆可以通过高斯约当消元法找到:
2D 旋转矩阵
2D Rotation Matrices
2D Rotation matrices by radians counter-clockwise about the origin are matrices in the form .
绕原点逆时针旋转 弧度的 2D 旋转矩阵是 形式的矩阵。
正交矩阵
Orthogonal Matrices
Orthogonal matrices (unitary matrices in the reals) are square with orthonormal row and column vectors. They are nonsingular and satisfy . Orthogonal matrices can be interpreted as rotation matrices.
正交矩阵(实数酉矩阵)是正交行向量和列向量的平方。它们是非奇异的并且满足 。正交矩阵可以解释为旋转矩阵。
幂等矩阵
Idempotent Matrices
Idempotent matrices are square matrices satisfying . In other words, the effect of applying the linear transformation twice is the same as applying it once. Projection matrices are Idempotent.
幂等矩阵是满足 的方阵。换句话说,应用两次线性变换 的效果与应用一次相同。投影矩阵是幂等的。
正半定矩阵
Positive Semi-definite Matrices
Covariance and correlation matrices are always positive semi-definite and positive definite if there is no perfect linear dependence among random variables. Each of the following conditions is a necessary and sufficient condition for to be positive semi-definite/definite:
如果随机变量之间不存在完美的线性相关性,则协方差和相关矩阵始终是正半定和正定矩阵。以下每个条件都是 为正半定/正定的充要条件:
| Positive Semi-Definite | Positive Definite |
|---|---|
| for all column vectors | for all nonzero column vectors |
| All eigenvalues are nonnegative | All eigenvalues are positive |
| All upper left/lower right submatrices have nonnegative determinants | All upper left/lower right submatrices have positive determinants |
| 半正定 | 正定 |
|---|---|
| for all column vectors | for all nonzero column vectors |
| 所有特征值都是非负的 | 所有特征值均为正 |
| 所有左上/右下子矩阵都有非负行列式 | 所有左上/右下子矩阵都有正行列式 |
Note that if has negative diagonal elements, then cannot be positive semi-definite.
请注意,如果 具有负对角线元素,则 不能是半正定的。
补充讲解
用映射和子空间理解矩阵
Think in maps and subspaces
矩阵是线性映射。秩、零空间、列空间和可逆性描述这个映射保留或丢失了哪些信息。
A matrix is a linear map. Rank, null space, column space, and invertibility describe what information the map preserves or loses.
半正定是协方差语言
PSD is the covariance language
协方差矩阵必须对称半正定。负特征值通常意味着估计噪声、数据问题或不合法的变换。
Covariance matrices must be symmetric positive semidefinite. Negative eigenvalues usually indicate estimation noise, data issues, or invalid transformations.
条件数影响实现可靠性
Conditioning affects implementation
即使公式在代数上正确,病态矩阵也会让数值求逆不稳定。必要时应优先使用矩阵分解或正则化。
Even when a formula is algebraically correct, ill-conditioned matrices can make numerical inversion unstable. Prefer decompositions or regularization when needed.