determin.ant
08-svd / 8.2

Module 8: SVD

SVD Explorer

Where you'll see this: the condition number σ₁/σ₂ tells you how numerically sensitive a matrix is. A high condition number means tiny input changes can cause huge output changes — a red flag for solving linear systems. Engineers and scientists check condition numbers before trusting any numerical result.

Now that you understand the structure of SVD, let's use it as a diagnostic tool. The singular values reveal everything important about a matrix.

Reading the SVD

Given A=UΣVTA = U \Sigma V^T:

  • The columns of V are the right singular vectors — the "input" axes
  • The columns of U are the left singular vectors — the "output" axes
  • σ₁ ≥ σ₂ ≥ 0 are the singular values — the stretch factors

A applies the transformation by: rotate input via Vᵀ, stretch by Σ, rotate output by U. The singular vectors tell you the directions of maximum and minimum stretch.

Singular values and rank

The rank of A equals the number of nonzero singular values. A rank-1 matrix has σ₂ = 0 — the transformation collapses to a line. Rank-2 (full rank) has both σ₁, σ₂ > 0.

The condition number

The condition number κ(A)=σ1/σ2\kappa(A) = \sigma_1 / \sigma_2 measures how "near-singular" a matrix is. If κ is large, small errors in b can cause large errors in the solution of Ax = b.

The image of the unit circle under A is an ellipse with semi-axes σ₁ and σ₂. The condition number is literally the aspect ratio of that ellipse.

Try it

Edit the matrix. The dashed circle shows the unit circle (all inputs of length 1). The green ellipse shows where those inputs map to. The blue and pink arrows are the singular value directions. Make σ₂ near zero to collapse the ellipse to a line.

Pseudoinverse via SVD:
import numpy as np
A = np.array([[2., 1.], [0., 1.5]])
U, s, Vh = np.linalg.svd(A)

# Pseudoinverse: V @ Σ⁺ @ Uᵀ
S_inv = np.diag(1.0 / s)
A_pinv = Vh.T @ S_inv @ U.T

# Same as:
print(np.allclose(A_pinv, np.linalg.pinv(A)))  # True
Rotate, Stretch, RotateMatrix Norms
[
]
î → [2, 0]ĵ → [1, 1.5]
σ1σ2

Singular values:

σ₁ = 2.38 σ₂ = 1.26

Condition number σ₁/σ₂ = 1.89· · rank = 2

The dashed circle = inputs. The green ellipse = where A maps the unit circle. Its semi-axes are σ₁ and σ₂.