Overview of the SVD (singular value decomposition)
For every A∈Rm×n there exist unique matrices U,Σ,V (up to a permutation of columns) such that U,V are orthogonal, Σ∈Rm×n is "diagonal" (a diagonal block plus zero blocks), and
A=UΣVT.
(Reminder: orthogonal means UT=U−1.)
The nonzero (diagonal) elements of Σ are called singular values and usually they are arranged in decreasing order.
Let r=rank(A)≤min(n,m). Define U1,Σ1,V1 as the first r columns of U,Σ,V (Σ1 is the r×r block with the nonzero singular values). They keep all the information about A:
A=U1Σ1V1T.
Pseudoinverse. The pseudoinverse of A is
A+=V1Σ1−1U1T.
The board writes AA+=Im and A+A=In (these hold in the full-rank situations; they cannot both hold for a rank-deficient matrix).
If A−1 exists, then A+=A−1.
If (ATA)−1 exists, then (ATA)−1AT=A+.
Least squares with the pseudoinverse
θ^LS(y)=argθmin∥y−Φθ∥2Claim: the solution given by θ^LS(y)=Φ+y is the minimal-norm solution.
If ΦTΦ is not invertible, all solutions are in the set
Θ={θ:ΦTΦθ=ΦTy},
and we focus on argminθ∈Θ∥θ∥2.
Step 1: rewrite the cost with the SVD.Φ=U1Σ1V1T=UΣVT and U=[U1U2] with U1 having r columns. If a matrix A is orthogonal, ∥Ax∥2=∥x∥2, so multiplying by UT does not change the norm:
∥y−Φθ∥2=∥y−U1Σ1V1Tθ∥2=UT(y−U1Σ1V1Tθ)2=(U1TU2T)(y−U1Σ1V1Tθ)2=(U1Ty−U1TU1Σ1V1TθU2Ty−U2TU1Σ1V1Tθ)2.
Because UTU=I we have U1TU1=I and U2TU1=0, so
=(U1Ty−Σ1V1TθU2Ty)2=∥U1Ty−Σ1V1Tθ∥2+∥U2Ty∥2.
The second term does not depend on θ ("who cares"). The first term can be minimised by carefully choosing θ: it is zero if
U1Ty=Σ1V1Tθ.
Step 2: all the solutions of this equation are
θ=V1Σ1−1U1Ty+z,z∈Ker(V1T).
Check: U1Ty=Σ1V1T(V1Σ1−1U1Ty+z)=Σ1V1TV1Σ1−1U1Ty+Σ1V1Tz=U1Ty, using V1TV1=I and V1Tz=0.
Step 3: the norm. Since Ker(V1T)=ImV2, write z=V2z~. Then
∥θ∥2=∥V1Σ1−1U1Ty+z∥2=∥V1Σ1−1U1Ty+V2z~∥2=∥V1Σ1−1U1Ty∥2+∥V2z~∥2,
because V1⊥V2.
Conclusion. If we choose z~=0, corresponding to z=0, we obtain
θ=V1Σ1−1U1Ty=Φ+y,
and the squared norm of θ is the smallest among all the least squares solutions.
Versione ripasso
If ΦTΦ is not invertible, the normal equation Ax=b (A=ΦTΦ, x=θ, b=ΦTy) is attacked with minx∥Ax−b∥2.
SVD: A=UΣVT, U,V orthogonal (UT=U−1), Σ "diagonal" with the singular values in decreasing order. With r=rankA: A=U1Σ1V1T (first r columns). Pseudoinverse A+=V1Σ1−1U1T; A+=A−1 if the inverse exists; (ATA)−1AT=A+ if ATA is invertible.
Result: θ^LS=Φ+y is the minimal-norm least squares solution.
Derivation: orthogonal U preserves norms, so ∥y−Φθ∥2=∥U1Ty−Σ1V1Tθ∥2+∥U2Ty∥2 (second term constant). Zeroing the first: θ=V1Σ1−1U1Ty+z, z∈KerV1T=ImV2. Since V1⊥V2, ∥θ∥2=∥V1Σ1−1U1Ty∥2+∥V2z~∥2, minimal at z=0.