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

A7 · Lesson 45 · The pseudoinverse

The best answer for any matrix

Only square matrices with nonzero determinants have inverses. Least squares handled tall matrices with independent columns. That leaves the awkward cases: wide matrices with infinitely many solutions, and rank-deficient ones that have too many and too few at once. The SVD settles all of them with one rule, the pseudoinverse A+. It gives the least-squares answer, and among all least-squares answers, the shortest. Circuits obey the same rule: currents split among parallel paths in the way that dissipates the least power.

  • Every point on the line is a solution of x+2y=b. The second dot is one of them; slide it along with s.
  • Its length is smallest at the point marked A+b, where the arrow from the origin meets the line at a right angle.
  • Change b. The line moves, and the shortest solution moves with it, always along the direction (1,2).

Predict

Which solution of x+2y=5 is shortest?

Name it

Definition

Write the SVD as A=UΣVT, with r nonzero singular values. The pseudoinverse inverts the nonzero ones and leaves the zeros alone:

A+=VΣ+UT,Σ+=diag(1σ1,…,1σr,0,…,0)

What A+𝐛 is

𝐱+=A+𝐛 minimizes |A𝐱−𝐛|, and among all minimizers it has the smallest length. It lies in the row space of A, and A𝐱+ is the projection of 𝐛 onto the column space.

Three special cases:

  • invertible A: A+=A−1;
  • independent columns (tall, rank n): A+=(ATA)−1AT, the least-squares formula;
  • independent rows (wide, rank m): A+=AT(AAT)−1, the minimum-norm solution of an underdetermined system.

Small singular values

A singular value near zero turns into a huge 1/σ, so noise in 𝐛 along that direction is amplified enormously. Two fixes:

  • truncation: treat σ below a threshold as zero;
  • Tikhonov regularization (ridge): minimize |A𝐱−𝐛|2+λ|𝐱|2, which replaces 1σ with σσ2+λ. Large singular values are hardly changed, and small ones are damped by the factor σ2σ2+λ.

Circuits minimize power

Maxwell showed that the currents in a resistor network are the ones that, among all current patterns obeying KCL, dissipate the least power ∑Rkik2. That's a weighted minimum-norm problem. For two parallel resistors sharing a current I, minimizing R1i12+R2i22 with i1+i2=I gives the current divider i1=R2R1+R2I.

Worked example

Find the shortest solution of x+2y=5.

Show the solution
  1. Pseudoinverse. A=[12] has one independent row, so A+=AT(AAT)−1=15[12]
  2. Shortest solution. 𝐱+=55(1,2)=(1,2)
  3. Why it's shortest. Every other solution adds a null-space vector t(2,−1), which is perpendicular to (1,2), so by Pythagoras it can only add length: |𝐱|2=5+5t2

Answer the shortest solution is (1,2).

Worked example

Find A+𝐛 for A=[1000] and 𝐛=(3,4).

Show the solution
  1. Invert the singular values. A is already its own SVD, with singular values 1 and 0. Inverting the 1 and keeping the 0 gives A+=[1000] so 𝐱+=(3,0).
  2. The best residual. No 𝐱 can match b2=4, since A𝐱 always has a zero second entry, so the residual is at least 4. Every (3,y) achieves that residual.
  3. The shortest choice. The pseudoinverse picks y=0, the shortest. It solves what can be solved and sets the rest to zero.

Answer A+𝐛=(3,0).

Worked example

A 3 mA current enters two parallel resistors, 1 kΩ and 2 kΩ. Show that the actual split dissipates the least power.

Show the solution
  1. The actual split. The current divider gives i1=3×23 = 2 mA in the 1 kΩ resistor and 1 mA in the 2 kΩ.
  2. Its power. Kilohms times milliamps squared give milliwatts: P=1×22+2×12=6mW
  3. Any other split. Take i1=2+t and i2=1−t: P=(2+t)2+2(1−t)2=6+3t2mW more, for every t≠0.
  4. An equal split. That's t=−0.5, which costs 6.75 mW.

Answer the actual 2 mA and 1 mA split dissipates 6 mW, and any other split dissipates 6+3t2 mW, which is more.

Check

Find the shortest solution of 2x+1y=10.

(a)

What is x?

(b)

What is y?

Check

A is the single column (1,3). What is the second entry of A+, a 1 × 2 row?

Check

A matrix's smallest singular value is 0.001. Noise of size 0.001 in 𝐛 along the matching 𝐮 direction changes A+𝐛 by how much?

Check

Tikhonov regularization with λ = 0.0001 is applied. By what factor is the singular value 0.1's contribution scaled, compared with the plain pseudoinverse?

Check

2 mA divides between 1 kΩ and 4.7 kΩ in parallel so as to dissipate the least power. How much flows in the 1 kΩ resistor?

Write units the way you normally would: 1.5 mA, 1500 µA and 0.0015 A are the same answer.

Check

Find the minimum-norm solution of px+qy=c from A+=AT(AAT)−1.

Step 1

What is AAT?

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 is the minimum-norm solution the one in the row space?

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.