A13 · Lesson 32 · The SVD
Rank, condition, best low-rank approximations and parallel channels
Every matrix, square or not, can be written as : a rotation, a stretch along perpendicular axes by the singular values , and another rotation. The singular values answer the practical questions numerical work keeps asking. How close is this matrix to singular? What is its rank, really, once noise is counted? What is the best approximation using only k numbers per row and column? In communications they also give the gains of the independent channels hidden inside a multi-antenna link.
- The dashed circle is the set of unit vectors x; the solid ellipse is where sends them.
- The ellipse's semi-axes are the singular values and . Their ratio is the condition number.
- Make the matrix nearly singular, for example a = d = 1 and b = c = 0.9: the ellipse flattens to a needle, approaches 0, and κ grows.
Predict
You compute a matrix's singular values as the square roots of the eigenvalues of , in double precision. The matrix has κ = . What happens to its smallest singular value?
It may be pure noise. Forming squares the condition number to , beyond double precision's , so the smallest eigenvalue of is lost in rounding. SVD software works on A directly (Golub–Kahan bidiagonalization), which gets small singular values to about absolute accuracy.
Name it
The decomposition
with U and V orthogonal and Σ diagonal. The columns of V are the directions A stretches most and least; . The are the eigenvalues of , but software never computes them that way.
What the singular values tell you
- Norm and condition: , and .
- Numerical rank: the number of singular values above a tolerance, such as , or the noise level of the data.
- Distance to singularity: the nearest singular matrix is away in the 2-norm.
Best low-rank approximation
Keeping the k largest terms, , gives the best rank-k approximation (Eckart–Young): its error is in the 2-norm and in the Frobenius norm. Storing takes numbers instead of mn.
Least squares and regularization
The pseudoinverse (invert the nonzero ) gives the minimum-norm least-squares solution. When small singular values are only noise, dividing by them amplifies it; truncated SVD drops them, trading a little bias for much less noise.
Parallel channels
A multi-antenna link becomes independent scalar channels with gains after rotating by at the transmitter and at the receiver. With power p per channel and unit noise, the capacity is bits per second per hertz.
Worked example
Find the singular values and condition number of .
Show the solution
- Form . For a small exact matrix this route is fine: Its eigenvalues are 45 and 5.
- Singular values.
- Condition number.
- Check. as it must for a square matrix.
- Eigenvalues understate it. The eigenvalues of A itself are 3 and 5, whose ratio, , understates how unevenly A stretches; for nonsymmetric matrices only the singular values measure that.
Answer , and .
Worked example
A 1000 × 1000 matrix of measurements is approximated by its 50 largest singular terms. How much storage does that take, and what is the error?
Show the solution
- Storage. Rank 50 needs numbers instead of : about 10% of the storage.
- Error. The error in the 2-norm is exactly , so the singular value plot tells you in advance how much each extra term buys.
- When the values fall quickly. With smooth images or correlated sensor arrays, a small rank captures nearly everything.
- When they level off. If they level off at a noise floor, the terms beyond that point are noise, and dropping them cleans the data as well as compressing it.
Answer 100 050 numbers, about 10% of the full matrix, with a 2-norm error of exactly .
Worked example
A 2 × 2 antenna link has singular values 2 and 0.5. With power 10 (relative to the noise) on each stream, what is its capacity?
Show the solution
- The strong stream. Each stream is an independent channel with gain : bits per second per hertz.
- The weak stream.
- Total. The total is 7.16 bits per second per hertz.
- Compare with one antenna pair. A single pair with gain 2 would give 5.36: the second spatial channel adds a third more, even though it is four times weaker.
- Water-filling. Water-filling, which puts more power on the stronger channel, would do slightly better still.
Answer 7.16 bits per second per hertz: 5.36 from the strong stream and 1.81 from the weak one.
Check
.
(a)
What is ?
(b)
What is ? (Use .)
Check
A matrix's singular values halve from each to the next, starting at = 10. What is the 2-norm error of its best rank-3 approximation?
Check
What fraction of the storage of a 1000 × 500 matrix does its rank-100 approximation need?
Check
A 2 × 2 antenna link has singular values 2 and 0.5, with power 100 per stream relative to the noise. What is its capacity per hertz?
Check
A matrix has . Solving least squares through , about how many digits can be lost?
Check
A 100 × 100 matrix from measurements has singular values 50, 20, 8, 3, then 96 values all near , the noise level. What is its useful rank?
Check
, a rotation times a scaling.
Step 1
What is the (1, 1) entry of ?
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°.
Step 2
What are its singular values?
Check
A 2 × 2 antenna link has channel matrix . Set s to its singular values (np.linalg.svd(H, compute_uv=False)) and C to the capacity , with power 10 per stream.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why is the truncated SVD the best low-rank approximation?
In the bases U and V, the matrix is just the diagonal of singular values, and rotations don't change 2-norm or Frobenius-norm distances. A rank-k matrix can keep at most k independent directions, so it must leave out at least one direction of a (k + 1)-dimensional space. Within the span of the first k + 1 right singular vectors, A stretches every vector by at least , while a rank-k matrix must send some unit vector there to zero, so the difference has norm at least . Keeping the k largest terms achieves exactly that error, so no rank-k matrix does better.
Practice
Keep practicing
7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.