Skip to content

LASummary

奇异值 特征值
定义 \(AA^T\) 特征值的平方根 \(A\) 的特征值
适用 \(A\) 任意矩阵 \(A\) 方阵
几何意义 描述矩阵对空间的缩放 描述矩阵对空间的旋转和缩放
求解 \(Av=\lambda v\) 奇异值分解: \(A=U\Sigma V^T\)
变换 仅在特征向量 \(v\) 方向进行比例系数为特征值 \(\lambda\) 的缩放 在左右奇异向量 \(U,V^T\) 上进行旋转, 在奇异值矩阵 \(\Sigma\) 上进行缩放
符号 非负 可正, 可负, 可复数

SVD

计算\(A^TA\), 特征向量组成 \(V^T\) 的列

计算\(AA^T\), 特征向量组成 \(U\) 的列

\(A=\left[ \begin{array}{cc}1&4 \\ 4&1\end{array}\right]\)

奇异值 \(\sigma_1=5,\sigma_2=3\)

\(U=V=\left[ \begin{array}{cc}\frac{1}{\sqrt 2}&\frac{1}{\sqrt 2} \\ \frac{1}{\sqrt 2}&-\frac{1}{\sqrt 2}\end{array}\right]\)

用代码观察:

import numpy as np
import matplotlib.pyplot as plt

# 构造矩阵 A
A = np.array([[1, 4], [4, 1]])

# 生成单位圆上的点
theta = np.linspace(0, 2*np.pi, 100)
circle = np.array([np.cos(theta), np.sin(theta)])

# 应用变换
transformed = A @ circle

# 画图
plt.figure(figsize=(6,6))
plt.plot(circle[0], circle[1], label='Unit Circle', color='blue')
plt.plot(transformed[0], transformed[1], label='Transformed Ellipse', color='red')
plt.axis('equal')
plt.title("Unit Circle → Ellipse under Matrix A")
plt.legend()
plt.grid(True)
plt.show()

vector norm

Minkowski

\[||x||_p=(|x_1|^p+|x_2|^p+\cdots +|x_n|^p)^{\frac 1p}\]

常见的有 \(1\), \(2\), \(\infty\) 范数, 分别对应 minkowski 距离的特例, 即 manhattan 距离, Euclid 距离, Chebyshev 距离

\[||x||_1=\sum_{i=1}^n|x_i|,||x||_2=\sqrt{\sum_{i=1}^nx_i^2},||x||_\infty=\max_{i=1}^n |x_i|\]

范数之间关系:

\[||x||_\infty\leq ||x||_2\leq \sqrt n ||x||_\infty\]
\[||x||_2\leq ||x||_1\leq \sqrt n||x||_2\]

第二个的左半:

\[||x||_1^2=\sum_{i}|x_i|^2+\sum_{i,j}2|x_i||x_j|\geq \sum_{i}|x_i|^2=||x||_2^2\]

两个右半都是基本不等式

matrix norm

Minkowski (Operator Norm)

Frobenius (Entrywise Norm)

\[||A||_F=\sqrt{\sum_{i=1}^m\sum_{j=1}^n |a_{i,j}|^2}=\sqrt{\mathrm{tr}(A^\top A)}\]

Gram Matrix and Scatter Matrix

对于 \(X\in \mathbb R^{d\times n}\):

Gram

\(X^\top X\in \mathbb R^{n\times n}\): 样本内积矩阵, 描述样本间的相似性

相当于两个样本做内积, 与 cosine similarity 类似

Scatter

\(XX^\top\in \mathbb{R}^{d\times d}\): 协方差型矩阵, 描述特征间的相似性

协方差矩阵是 \(\frac 1n XX^\top\)

connections

非零特征值相同

对于奇异值分解:

\(X=U\Sigma V^\top,XX^\top=V\Sigma^2V^\top, X^\top X=U\Sigma^2U^\top\)

0

任意向量空间都至少包含全 \(0\) 向量

空向量组 \(()\) 张成空间为 \(\set{0}\)