解超定方程 Ax=0 与奇异值分解

Reference:

  1. 解超定方程 Ax=0

文章跳转:

  1. 奇异值分解SVD 与 主成分分析PCA
  2. 拉格朗日乘子法

前文已经介绍了奇异值分解,现在来聊聊奇异值分解的一个应用。

工程中很多问题会归结为求解超定方程 A x = 0 \mathbf{Ax}=0 Ax=0 A \mathbf{A} A m × n m\times n m×n 的矩阵,且 m > n m> n m>n。如SLAM中三角化地图点PnP 等一些问题都是求解这个方程。
很显然,这个方程有一个零解,但这不是我们想要的,我们实际想求非零解。

为了求非零解,我们对 x \mathbf{x} x 加上一个约束 ∥ x ∥ 2 = 1 \|\mathbf{x}\|^2=1 x2=1 。也就是限制 x \mathbf{x} x 的长度为 1 。并构建成一个带约束的最小二乘问题
x ^ = arg ⁡ min ⁡ ∥ A x ∥ 2 ,  subject to  ∥ x ∥ 2 = 1 (1) \tag{1} \hat{\mathbf{x}}=\arg \min \|\mathbf{A} \mathbf{x}\|^2, \text { subject to }\|\mathbf{x}\|^2=1 x^=argminAx2, subject to x2=1(1)这是一个带约束的最小二乘问题,我们把拉格朗日搬出来:
L ( x , λ ) = ∥ A x ∥ 2 + λ ( 1 − ∥ x ∥ 2 ) = x T A T A x + λ ( 1 − x T x ) (2) \tag{2} \begin{aligned} L(\mathbf{x}, \lambda) & =\|\mathbf{A} \mathbf{x}\|^2+\lambda\left(1-\|\mathbf{x}\|^2\right) \\ & =\mathbf{x}^T \mathbf{A}^T \mathbf{A} \mathbf{x}+\lambda\left(1-\mathbf{x}^T \mathbf{x}\right) \end{aligned} L(x,λ)=Ax2+λ(1x2)=xTATAx+λ(1xTx)(2)为了求极值,我们分别对 x \mathbf{x} x λ \lambda λ 求偏导数,令为 0 0 0
∂ L ( x , λ ) ∂ x = 2 A T A x − 2 λ x = 0 (3) \tag{3} \begin{array}{l} \frac{\partial L(\mathbf{x}, \lambda)}{\partial \mathbf{x}}=2 \mathbf{A}^T \mathbf{A} \mathbf{x}-2 \lambda \mathbf{x}=0\end{array} xL(x,λ)=2ATAx2λx=0(3) ∂ L ( x , λ ) ∂ λ = 1 − x T x = 0 (4) \tag{4} \begin{array}{l} \frac{\partial L(\mathbf{x}, \lambda)}{\partial \lambda}=1-\mathbf{x}^T \mathbf{x}=0 \end{array} λL(x,λ)=1xTx=0(4)把(3)式整理一下:
( A T A − λ I ) x = 0 (5) \tag{5} \begin{array}{r} \left(\mathbf{A}^T \mathbf{A}-\lambda \mathbf{I}\right) \mathbf{x}=0 \end{array} (ATAλI)x=0(5) A T A x = λ x (6) \tag{6}\begin{array}{r} \mathbf{A}^T \mathbf{A} \mathbf{x}=\lambda \mathbf{x} \end{array} ATAx=λx(6)可以看出 λ \lambda λ x \mathbf{x} x 分别是 A T A \mathbf{A}^T \mathbf{A} ATA特征值特征向量。也就是说(1)式的解,就是这些特征向量中的一个。
问题来了,那么多的特征向量,应该选择哪个作为解呢?我们展开 ∥ A x ∥ 2 \|\mathbf{A x}\|^2 Ax2 看一下:
∥ A x ∥ 2 = x T A T A x = x T λ x = λ x T x = λ (7) \tag{7} \|\mathbf{A} \mathbf{x}\|^2=\mathbf{x}^T \mathbf{A}^T \mathbf{A} \mathbf{x}=\mathbf{x}^T \lambda \mathbf{x}=\lambda \mathbf{x}^T \mathbf{x}=\lambda Ax2=xTATAx=xTλx=λxTx=λ(7)

上方公式(7)的推导,利用了公式(6) 及 ∥ x ∥ 2 = 1 \|\mathbf{x}\|^2=1 x2=1

也就是说,我们想要 ∥ A x ∥ 2 \|\mathbf{A} \mathbf{x}\|^2 Ax2 最小,就需要 λ \lambda λ 最小
方程(1)的非零解就是 A T A \mathbf{A}^T\mathbf{A} ATA 最小特征值 λ \lambda λ 对应的特征向量,即最小奇异值对应的右奇异向量

猜你喜欢

转载自blog.csdn.net/qq_28087491/article/details/130125451