矩阵分解相关知识点总结(四)
文章目录
- 四、矩阵的满秩分解
- 五、矩阵的奇异值分解
书接上上文矩阵分解相关知识点总结(二)
四、矩阵的满秩分解
设 A ∈ C r m × n ( r > 0 ) A\in C_r^{m\times n}(r>0) A∈Crm×n(r>0),存在矩阵 F ∈ C r m × r F\in C_r^{m\times r} F∈Crm×r和 G ∈ C r r × n G\in C_r^{r\times n} G∈Crr×n,使得
A = F G (7) \color{#F00}A=FG\tag{7} A=FG(7)
其中 r r r为矩阵的秩, F F F是列满秩矩阵, G G G是行满秩矩阵,上式即为矩阵的满秩分解。当 A A A是满秩(列满秩或行满秩)矩阵时, A A A可分解为一个因子是单位矩阵,另一个因子是 A A A本身,称此满秩分解为平凡分解。
五、矩阵的奇异值分解
设 A ∈ C r m × n ( r > 0 ) A\in C_r^{m\times n}(r>0) A∈Crm×n(r>0),则存在 m m m阶酉矩阵 U U U和 n n n阶酉矩阵 V V V,使得
A = U D V H = U [ Σ O O O ] V H (8) \color{#F00}A=UDV^{\rm H}=U \begin{bmatrix} {\mathit\Sigma} & O \\ O & O \end{bmatrix} V^{\rm H}\tag{8} A=UDVH=U[ΣOOO]VH(8)
其中, V H V^{\rm H} VH代表酉矩阵 V V V的共轭转置, Σ = d i a g ( σ 1 , σ 2 , ⋯ , σ r ) \color{#F0F}{\mathit\Sigma}={\rm{diag}}(\sigma_1,\sigma_2,\cdots,\sigma_r) Σ=diag(σ1,σ2,⋯,σr), σ i ( i = 1 , 2 , ⋯ , r ) \sigma_i(i=1,2,\cdots,r) σi(i=1,2,⋯,r)为矩阵 A A A的全部非零奇异值。上式即为矩阵的奇异值分解(Singular Value Decomposition,简称SVD分解),当 A A A为实对称矩阵时,也称正交对角分解。
矩阵的奇异值分解在最优化问题、特征值问题、最小二乘问题、广义逆矩阵问题及统计学等方面都有重要应用。下面通过一个具体实例,将矩阵 A = [ 1 0 0 1 1 1 ] A=\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} A= 101011 进行SVD分解。
-
首先计算 A T A = [ 1 0 1 0 1 1 ] [ 1 0 0 1 1 1 ] = [ 2 1 1 2 ] A^{\rm T}A=\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix}=\begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix} ATA=[100111] 101011 =[2112]
-
对矩阵 A T A A^{\rm T}A ATA,由 ∣ λ I − A T A ∣ = ∣ λ − 2 − 1 − 1 λ − 2 ∣ = ( λ − 1 ) ( λ − 3 ) = 0 |\lambda I-A^{\rm T}A|=\begin{vmatrix} \lambda-2 & -1 \\ -1 & \lambda-2 \\ \end{vmatrix}=(\lambda-1)(\lambda-3)=0 ∣λI−ATA∣= λ−2−1−1λ−2 =(λ−1)(λ−3)=0,得特征值 λ 1 = 1 , λ 2 = 3 \lambda_1=1,\,\lambda_2=3 λ1=1,λ2=3,对应的特征向量分别为:
ξ 1 = k 1 [ 1 − 1 ] , ξ 2 = k 2 [ 1 1 ] \bm \xi_1=k_1\begin{bmatrix} 1 \\ -1 \\ \end{bmatrix},\quad\bm \xi_2=k_2\begin{bmatrix} 1 \\ 1 \\ \end{bmatrix} ξ1=k1[1−1],ξ2=k2[11]
- 于是有
Σ = d i a g ( λ 1 , λ 2 ) = [ 1 0 0 3 ] D = [ Σ O O O ] = [ 1 0 0 3 0 0 ] V = [ ξ 1 ∥ ξ 1 ∥ ξ 2 ∥ ξ 2 ∥ ] = [ 1 2 1 2 − 1 2 1 2 ] , 这里 V 可以有四种解 \begin{array}{l} \mathit\Sigma={\rm diag}(\sqrt{\lambda_1},\sqrt{\lambda_2})= \begin{bmatrix} 1 & 0 \\ 0 & \sqrt{3} \end{bmatrix}\\ D=\begin{bmatrix} {\mathit\Sigma} & O \\ O & O \end{bmatrix}=\begin{bmatrix} 1 & 0 \\ 0 & \sqrt{3} \\0 & 0\end{bmatrix}\\ V= \begin{bmatrix} \cfrac{\bm \xi_1}{\|\bm \xi_1\|} & \cfrac{\bm \xi_2}{\|\bm \xi_2\|} \end{bmatrix}= \begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \end{bmatrix},\;\text{这里$V$可以有四种解} \end{array} Σ=diag(λ1,λ2)=[1003]D=[ΣOOO]= 100030 V=[∥ξ1∥ξ1∥ξ2∥ξ2]= 21−212121 ,这里V可以有四种解
- 计算
U 1 = A V Σ − 1 = [ 1 0 0 1 1 1 ] [ 1 2 1 2 − 1 2 1 2 ] [ 1 0 0 1 3 ] = [ 1 2 1 6 − 1 2 1 6 0 2 6 ] U_1=AV{\mathit\Sigma}^{-1}=\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} \begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 0 & \cfrac{1}{\sqrt{3}} \end{bmatrix}= \begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} \\ 0 & \cfrac{2}{\sqrt{6}} \end{bmatrix} U1=AVΣ−1= 101011 21−212121 10031 = 21−210616162
- 构造一个列向量 U 2 = [ α 1 , α 2 , α 3 ] T U_2=[\alpha_1,\alpha_2,\alpha_3]^{\rm T} U2=[α1,α2,α3]T,使得 U = [ U 1 U 2 ] = [ 1 2 1 6 α 1 − 1 2 1 6 α 2 0 2 6 α 3 ] U=\left[\begin{array}{c|c}U_1&U_2\end{array}\right]=\begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} & \alpha_1 \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} & \alpha_2 \\ 0 & \cfrac{2}{\sqrt{6}} & \alpha_3\end{bmatrix} U=[U1U2]= 21−210616162α1α2α3 为酉矩阵,即有:
[ 1 2 − 1 2 0 1 6 1 6 2 6 ] [ α 1 α 2 α 3 ] = 0 , 且 α 1 2 + α 2 2 + α 3 2 = 1 \begin{bmatrix} \cfrac{1}{\sqrt{2}} & -\cfrac{1}{\sqrt{2}} & 0\\ \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{6}} & \cfrac{2}{\sqrt{6}} \end{bmatrix} \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \end{bmatrix}={\bf 0},\quad且\sqrt{\alpha_1^2+\alpha_2^2+\alpha_3^2}=1 2161−2161062 α1α2α3 =0,且α12+α22+α32=1
得 U 2 = ± [ 1 3 1 3 − 1 3 ] \;U_2=\pm\begin{bmatrix} \cfrac{1}{\sqrt{3}} & \cfrac{1}{\sqrt{3}} & -\cfrac{1}{\sqrt{3}} \end{bmatrix} U2=±[3131−31]
取 U = [ 1 2 1 6 1 3 − 1 2 1 6 1 3 0 2 6 − 1 3 ] , 这里 U 可以有两种解 U=\begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{3}} \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{3}} \\ 0 & \cfrac{2}{\sqrt{6}} & -\cfrac{1}{\sqrt{3}}\end{bmatrix},\;\text{这里$U$可以有两种解} U= 21−2106161623131−31 ,这里U可以有两种解
- 最后, A A A的SVD分解为:
A = U D V T = [ 1 2 1 6 1 3 − 1 2 1 6 1 3 0 2 6 − 1 3 ] [ 1 0 0 3 0 0 ] [ 1 2 1 2 − 1 2 1 2 ] T = [ 1 0 0 1 1 1 ] A=UDV^{\rm T}=\begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{3}} \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{3}} \\ 0 & \cfrac{2}{\sqrt{6}} & -\cfrac{1}{\sqrt{3}}\end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & \sqrt{3} \\0 & 0\end{bmatrix}\begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \\ -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \end{bmatrix}^{\rm T} =\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} A=UDVT= 21−2106161623131−31 100030 21−212121 T= 101011
当调整奇异值的顺序,使 Σ = [ 3 0 0 1 ] \mathit\Sigma= \begin{bmatrix} \sqrt{3} & 0 \\ 0 & 1 \end{bmatrix} Σ=[3001]时,可得
D = [ 3 0 0 1 0 0 ] V = [ 1 2 1 2 1 2 − 1 2 ] , 这里 V 可以有四种解 U = [ 1 6 1 2 1 3 1 6 − 1 2 1 3 2 6 0 − 1 3 ] , 这里 U 可以有两种解 \begin{array}{l} D=\begin{bmatrix} \sqrt{3} & 0 \\ 0 & 1 \\0 & 0\end{bmatrix}\\ V=\begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \\ \cfrac{1}{\sqrt{2}} & -\cfrac{1}{\sqrt{2}} \end{bmatrix},\;\text{这里$V$可以有四种解}\\ U=\begin{bmatrix} \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{3}} \\ \cfrac{1}{\sqrt{6}} & -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{3}} \\ \cfrac{2}{\sqrt{6}} & 0 & -\cfrac{1}{\sqrt{3}}\end{bmatrix},\;\text{这里$U$可以有两种解} \end{array} D= 300010 V= 212121−21 ,这里V可以有四种解U= 61616221−2103131−31 ,这里U可以有两种解
A = U D V T = [ 1 6 1 2 1 3 1 6 − 1 2 1 3 2 6 0 − 1 3 ] [ 3 0 0 1 0 0 ] [ 1 2 1 2 1 2 − 1 2 ] T = [ 1 0 0 1 1 1 ] A=UDV^{\rm T}=\begin{bmatrix} \cfrac{1}{\sqrt{6}} & \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{3}} \\ \cfrac{1}{\sqrt{6}} & -\cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{3}} \\ \cfrac{2}{\sqrt{6}} & 0 & -\cfrac{1}{\sqrt{3}}\end{bmatrix} \begin{bmatrix} \sqrt{3} & 0 \\ 0 & 1 \\0 & 0\end{bmatrix} \begin{bmatrix} \cfrac{1}{\sqrt{2}} & \cfrac{1}{\sqrt{2}} \\ \cfrac{1}{\sqrt{2}} & -\cfrac{1}{\sqrt{2}} \end{bmatrix}^{\rm T} =\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} A=UDVT= 61616221−2103131−31 300010 212121−21 T= 101011
可以看到,矩阵的奇异值分解通常不是唯一的。