Linear-Algebra-Done-Right ยท Unit 22 ยท Video 3 ยท Interactive Practice

Best Low-Rank Approximation: Truncate the SVD at k

IKey Formulas

FormulaNameWhat it says
Tkv=s1โŸจv,e1โŸฉf1+โ‹ฏ+skโŸจv,ekโŸฉfkT_kv = s_1\langle v, e_1\rangle f_1 + \cdots + s_k\langle v, e_k\rangle f_kTruncated SVDdimโกrangeโกTk=k\dim \operatorname{range} T_k = k
โˆฅTโˆ’Tkโˆฅ=sk+1\|T - T_k\| = s_{k+1}Error of the truncationThe first discarded singular value, for 1โ‰คk<m1 \le k \lt m
โˆฅTโˆ’Sโˆฅโ‰ฅsk+1\|T - S\| \ge s_{k+1} if dimโกrangeโกSโ‰คk\dim \operatorname{range} S \le kNo map does betterSome nonzero uโˆˆspanโก(e1,โ€ฆ,ek+1)u \in \operatorname{span}(e_1, \dots, e_{k+1}) has Su=0Su = 0
k(M+N+1)k(M + N + 1) numbers instead of MNMNStorage of TkT_kFor an MM-by-NN matrix

Key Insight: minโก{โˆฅTโˆ’Sโˆฅ:dimโกrangeโกSโ‰คk}=sk+1\min\{\|T - S\| : \dim \operatorname{range} S \le k\} = s_{k+1}, so the error depends only on the first singular value thrown away, not on how many come after it.

IICompressing a Matrix by Truncation

Keeping kk terms of the SVD of an 8-by-8 matrix leaves an error of exactly sk+1s_{k+1}.

IIINo Rank-One Map Gets Closer Than s2s_2

For T(x,y)=(3x,2y)T(x, y) = (3x, 2y), every map Sv=โŸจv,aโŸฉbSv = \langle v, a\rangle b leaves โˆฅTโˆ’Sโˆฅโ‰ฅs2=2\|T - S\| \ge s_2 = 2.

๐Ÿ’ก Challenge: find a rank-one SS other than T1T_1 that also reaches โˆฅTโˆ’Sโˆฅ=2\|T - S\| = 2.

IVQuiz Questions

Problem 1 ยท The Error of a Truncation

Given: TโˆˆL(V,W)T \in \mathcal{L}(V, W) with positive singular values 9โ‰ฅ5โ‰ฅ2โ‰ฅ129 \ge 5 \ge 2 \ge \tfrac12, and T2T_2 the first two terms of a singular value decomposition of TT โ€” find โˆฅTโˆ’T2โˆฅ\|T - T_2\|.

โœ… Correct! Tโˆ’T2T - T_2 is the tail 2โŸจv,e3โŸฉf3+12โŸจv,e4โŸฉf42\langle v, e_3\rangle f_3 + \tfrac12\langle v, e_4\rangle f_4, whose largest coefficient is s3=2s_3 = 2.
โŒ Not quite. The discarded singular values act on orthogonal directions, so they do not add: no unit vector gets stretched by 2+122 + \tfrac12.
โŒ Not quite. 5=s25 = s_2 is the last singular value kept. The error is the first one discarded.
โŒ Not quite. 22+(1/2)2\sqrt{2^2 + (1/2)^2} would need one unit vector stretched by both discarded values at once; the norm is the largest single stretch.
Show solution

(Tโˆ’T2)v=2โŸจv,e3โŸฉf3+12โŸจv,e4โŸฉf4(T - T_2)v = 2\langle v, e_3\rangle f_3 + \tfrac12\langle v, e_4\rangle f_4. Since f3,f4f_3, f_4 is orthonormal and by Bessel's inequality,

โˆฅ(Tโˆ’T2)vโˆฅ2=4โˆฃโŸจv,e3โŸฉโˆฃ2+14โˆฃโŸจv,e4โŸฉโˆฃ2โ‰ค4(โˆฃโŸจv,e3โŸฉโˆฃ2+โˆฃโŸจv,e4โŸฉโˆฃ2)โ‰ค4โˆฅvโˆฅ2.\|(T - T_2)v\|^2 = 4|\langle v, e_3\rangle|^2 + \tfrac14|\langle v, e_4\rangle|^2 \le 4\big(|\langle v, e_3\rangle|^2 + |\langle v, e_4\rangle|^2\big) \le 4\|v\|^2.

And (Tโˆ’T2)e3=2f3(T - T_2)e_3 = 2f_3 has length 22. So โˆฅTโˆ’T2โˆฅ=s3=2\|T - T_2\| = s_3 = 2.

Problem 2 ยท The Best Rank-One Approximation

Given: TโˆˆL(R3)T \in \mathcal{L}(\mathbf{R}^3) defined by T(x,y,z)=(x,โˆ’6y,4z)T(x, y, z) = (x, -6y, 4z) โ€” which SS with dimโกrangeโกSโ‰ค1\dim \operatorname{range} S \le 1 minimizes โˆฅTโˆ’Sโˆฅ\|T - S\|?

โœ… Correct! The largest singular value is 6=โˆฃโˆ’6โˆฃ6 = |-6|, so T1=(0,โˆ’6y,0)T_1 = (0, -6y, 0), and โˆฅTโˆ’T1โˆฅ=s2=4\|T - T_1\| = s_2 = 4.
โŒ Not quite. The first coordinate is not the most important one: then Tโˆ’S=(0,โˆ’6y,4z)T - S = (0, -6y, 4z) has norm 66.
โŒ Not quite. Singular values are absolute values: โˆฃโˆ’6โˆฃ=6>4|-6| = 6 > 4. Keeping 4z4z leaves Tโˆ’S=(x,โˆ’6y,0)T - S = (x, -6y, 0) with norm 66.
โŒ Not quite. This SS has a range of dimension 22, so it is not allowed.
Show solution

Tโˆ—T(x,y,z)=(x,36y,16z)T^*T(x, y, z) = (x, 36y, 16z), so the singular values are 6,4,16, 4, 1. A singular value decomposition is Tv=6โŸจv,e2โŸฉ(โˆ’e2)+4โŸจv,e3โŸฉe3+1โŸจv,e1โŸฉe1Tv = 6\langle v, e_2\rangle(-e_2) + 4\langle v, e_3\rangle e_3 + 1\langle v, e_1\rangle e_1, with e1,e2,e3e_1, e_2, e_3 the standard basis. Truncating after one term gives

T1(x,y,z)=6yโ€‰(โˆ’e2)=(0,โˆ’6y,0),T_1(x, y, z) = 6y\,(-e_2) = (0, -6y, 0),

and (Tโˆ’T1)(x,y,z)=(x,0,4z)(T - T_1)(x, y, z) = (x, 0, 4z) has norm 4=s24 = s_2. By the best-approximation theorem no SS with dimโกrangeโกSโ‰ค1\dim \operatorname{range} S \le 1 comes closer. The other choices leave the stretch 66 in Tโˆ’ST - S.

Problem 3 ยท How Much Storage

Given: a 500500-by-300300 matrix stored as its truncation TkT_k with k=10k = 10 (the sjs_j, the eje_j and the fjf_j for jโ‰ค10j \le 10) โ€” how many numbers are stored?

โœ… Correct! 10(500+300+1)=801010(500 + 300 + 1) = 8010, about 5.3%5.3\% of the 150โ€‰000150\,000 entries.
โŒ Not quite. 500โ‹…300500 \cdot 300 stores every entry, which is what the truncation avoids.
โŒ Not quite. That counts the vectors eje_j and fjf_j but forgets the 1010 singular values themselves.
โŒ Not quite. Each term needs a vector in F300\mathbf{F}^{300} and a vector in F500\mathbf{F}^{500}, plus sjs_j.
Show solution

The matrix is a map from F300\mathbf{F}^{300} to F500\mathbf{F}^{500}. Each of the k=10k = 10 terms sjโŸจv,ejโŸฉfjs_j\langle v, e_j\rangle f_j needs the number sjs_j, the vector ejโˆˆF300e_j \in \mathbf{F}^{300} and the vector fjโˆˆF500f_j \in \mathbf{F}^{500}:

10โ€‰(1+300+500)=801010\,(1 + 300 + 500) = 8010

numbers, instead of 500โ‹…300=150โ€‰000500 \cdot 300 = 150\,000. The largest error on a unit vector is s11s_{11}.

Problem 4 ยท A Repeated Singular Value

Given: TโˆˆL(V,W)T \in \mathcal{L}(V, W) with positive singular values 7โ‰ฅ3โ‰ฅ3โ‰ฅ17 \ge 3 \ge 3 \ge 1 โ€” find minโก{โˆฅTโˆ’Sโˆฅ:SโˆˆL(V,W),ย dimโกrangeโกSโ‰ค2}\min\{\|T - S\| : S \in \mathcal{L}(V, W),\ \dim \operatorname{range} S \le 2\}.

โœ… Correct! The minimum is s3=3s_3 = 3; the repeated value means dropping the third term costs as much as dropping the second would.
โŒ Not quite. 1=s41 = s_4 is the error for k=3k = 3. With k=2k = 2 the first discarded value is s3=3s_3 = 3; repeated values are listed separately.
โŒ Not quite. TT has four positive singular values, so dimโกrangeโกT=4\dim \operatorname{range} T = 4, and no map with a range of dimension 22 equals it.
โŒ Not quite. 32+12\sqrt{3^2 + 1^2} adds the discarded stretches in quadrature, but the norm is the largest single one.
Show solution

Here m=4m = 4 and k=2<mk = 2 \lt m, so by the best-approximation theorem the minimum is sk+1=s3s_{k+1} = s_3. The list of singular values repeats 33, so s2=s3=3s_2 = s_3 = 3:

minโก{โˆฅTโˆ’Sโˆฅ:dimโกrangeโกSโ‰ค2}=s3=3,\min\{\|T - S\| : \dim \operatorname{range} S \le 2\} = s_3 = 3,

attained at S=T2S = T_2, for which Tโˆ’T2=3โŸจv,e3โŸฉf3+โŸจv,e4โŸฉf4T - T_2 = 3\langle v, e_3\rangle f_3 + \langle v, e_4\rangle f_4.

Solved: 0 / 4