A744 of 56
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A7 · Lesson 44 · The SVD

Every matrix is a rotation, a stretch and a rotation

A Wi-Fi router with several antennas talks to a laptop with several antennas, and every transmit antenna reaches every receive antenna through its own path: the channel is a matrix H. Mixed up like that, the streams interfere. But every matrix, square or not, can be written as a rotation, then a stretch along perpendicular axes, then another rotation. Precode with the first rotation and decode with the last, and the tangled channel becomes a set of separate, non-interfering channels, one per singular value. That decomposition, the SVD, also compresses images, removes noise, and measures how close a matrix is to singular.

  • The curve is the unit circle after the matrix A=[abcd]: always an ellipse.
  • The arrow is the ellipse's long semi-axis, of length σ1. The short semi-axis has length σ2.
  • Make A nearly singular. What happens to σ2? Compare σ1σ2 with |det⁡A|.

Predict

A 2 × 2 matrix has singular values 6 and 0.01. What does it do to the unit circle?

Name it

The decomposition

Every m×n matrix A of rank r can be written

A=UΣVT=σ1𝐮1𝐯1T+⋯+σr𝐮r𝐯rT
  • V (n×n) and U (m×m) are orthogonal: their columns are orthonormal.
  • Σ is m×n with the singular values σ1≥σ2≥⋯≥σr>0 on its diagonal.
  • A𝐯i=σi𝐮i: the right singular vectors 𝐯i go to the left singular vectors 𝐮i, stretched by σi.

The σi2 are the eigenvalues of ATA (and of AAT), and the 𝐯i are its eigenvectors. Unlike eigenvalues, singular values exist for every matrix, are real and never negative.

Geometry

VT rotates, Σ stretches along the axes, U rotates: the unit sphere becomes an ellipsoid with semi-axes σi along 𝐮i. For a square matrix, |det⁡A|=σ1σ2⋯σn.

Low-rank approximation

Keeping the first k terms gives Ak, the best rank-k approximation to A (Eckart-Young). Its error, measured as the root of the sum of squared entries (the Frobenius norm), is

‖A−Ak‖F=σk+12+⋯+σr2

A photo whose singular values fall quickly can be stored with a few terms: k(m+n+1) numbers instead of mn.

MIMO channels

With H=UΣVT, transmit V𝐬 and multiply the received signal by UT: you get Σ𝐬 plus noise, separate channels with gains σi. Weak σi get little power; strong ones carry most of the data. S8 builds on this.

Worked example

Find the singular values of A=[3045].

Show the solution
  1. Form ATA. ATA=[25202025]
  2. Its eigenvalues. They are 25±20: 45 and 5.
  3. Singular values. σ1=45=6.708σ2=5=2.236
  4. Check. σ1σ2=15=|det⁡A|

Answer σ1=6.708 and σ2=2.236.

Worked example

A 512 × 512 image is stored as its rank-20 approximation. How much smaller is it, and when is that a good idea?

Show the solution
  1. Full storage. 5122=262144numbers
  2. Rank-20 storage. 20×(512+512+1)=20500 about 13 times smaller.
  3. When it works. It's good when σ21,σ22,… are small compared with the first ones, so the discarded part, of size σ212+⋯, is a small fraction of the whole.

Answer about 13 times smaller (20 500 numbers against 262 144), and a good idea when the singular values after the 20th are small.

Worked example

Find the singular values of A=𝐮𝐯T with 𝐮=(1,2) and 𝐯=(3,4).

Show the solution
  1. Rank. Every column of A is a multiple of 𝐮, so its rank is 1 and it has one nonzero singular value.
  2. SVD form. Writing it this way puts it in SVD form directly: A=|𝐮||𝐯|𝐮|𝐮|𝐯T|𝐯|
  3. Read off σ1. σ1=|𝐮||𝐯|=5⋅5=11.18 and σ2=0.
  4. The bigger picture. A matrix built from one outer product is one rank-one piece of an SVD. Any matrix is a sum of such pieces, largest first.

Answer σ1=11.18 and σ2=0.

Check

What is the larger singular value of [200−5]?

Check

A 2 × 2 matrix has det⁡A = −6 and largest singular value 4. What is σ2?

Check

What is σ1 for [3021]?

Check

A matrix has singular values 10, 3 and 2. What is the relative error ‖A−A1‖F‖A‖F of its best rank-1 approximation?

Check

A 256 × 256 image is stored as its rank-10 approximation. What percent of the original numbers does that take?

Check

A is a 6 × 5 NumPy array that's nearly low-rank. Using np.linalg.svd, set Ak to its best rank-2 approximation and rel_err to ‖A−Ak‖F/‖A‖F.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Singular values.

(a)

What is σ1 of [1133]?

(b)

What is σ1/σ2 for [500−1]?

Check

Find the SVD of A=[xy00].

Step 1

What is the trace of ATA?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why are the singular values of A the square roots of the eigenvalues of ATA?

Practice

Keep practicing

10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.