11.4  Least Squares and Minimum-Norm Solutions

Chapter 3 taught us to decide whether Ax=b has a solution, and to find them all when it does. Real data rarely cooperates. Measure a quantity that depends linearly on two unknowns, take ten measurements, and you have ten equations in two unknowns; each measurement carries a little error, and the ten equations are almost certainly inconsistent. Refusing to answer is not useful. This section replaces the question “which x solves Ax=b?” with “which x comes closest?”, and shows that the new question always has an answer, computed by solving a square system.

The other half of the section handles the opposite complaint. When a system is consistent but underdetermined, there are too many solutions, and we want a canonical one. Orthogonality picks it: exactly one solution is perpendicular to the kernel, and it is the shortest.

Throughout, F=R or F=C, and Fn and Fm carry the standard inner product ⟨x,y⟩=∑ixiyi―, with ‖x‖2=∑i|xi|2.

11.4.1. The residual, and a piece of notation

Given A∈Mm×n(F) and b∈Fm, write r=b−Ax for the residual of a candidate x. The system is consistent exactly when some x makes r=0. When none does, we ask for the x making r as short as possible, that is, minimizing ‖Ax−b‖2=∑i=1m|(Ax)i−bi|2, a sum of squares; hence the name least squares.

Two observations turn this into geometry. First, as x ranges over Fn, the vector Ax ranges over exactly the column space col(A)⊆Fm (Theorem 0.9.3), a finite-dimensional subspace. Second, minimizing ‖Ax−b‖ over all x is therefore the same as finding the point of col(A) nearest to b. We already know that point: it is Pcol(A)b, by Theorem 11.3.5. All that remains is to turn “the residual is perpendicular to col(A)” into equations, and for that we need one piece of notation.

Recall the conjugate transpose A∗∈Mn×m(F) of Definition 11.1.2: the matrix with entries (A∗)ij=aji―, obtained by transposing and then conjugating every entry, so that A∗=A⊤ over R. Comparing entries and using Theorem 0.9.5 together with the rules for conjugation (Theorem 0.6.2) gives (A+B)∗=A∗+B∗,(cA)∗=c―A∗,(AB)∗=B∗A∗,A∗∗=A, whenever the sizes match. The third is the one worth seeing done: ((AB)∗)ij=(AB)ji―=∑kajkbki―=∑kbki―ajk―=∑k(B∗)ik(A∗)kj=(B∗A∗)ij, which is where the order reverses. The one consequence we really use is the following.

Lemma 11.4.1 (Moving a matrix across the inner product)

Let A∈Mm×n(F). Then for all x∈Fn and y∈Fm, ⟨Ax,y⟩=⟨x,A∗y⟩,⟨y,Ax⟩=⟨A∗y,x⟩.

Proof. Regarding vectors as columns, ⟨u,w⟩=w∗u, a 1×1 matrix identified with its entry. Hence ⟨Ax,y⟩=y∗(Ax)=(y∗A)x=((A∗y)∗)x=⟨x,A∗y⟩, where the third equality uses (A∗y)∗=y∗A∗∗=y∗A. The second identity follows by conjugating the first, since ⟨y,Ax⟩=⟨Ax,y⟩― and ⟨x,A∗y⟩―=⟨A∗y,x⟩.

The lemma is the matrix case of a general principle: to move a map across an inner product, pay with its adjoint. Section 6 develops that principle for linear maps between abstract inner product spaces; here the two lines above are all we need.

11.4.2. The normal equations

Theorem 11.4.2 (Least Squares Theorem)

Let A∈Mm×n(F) and b∈Fm, and write U=col(A). For x∈Fn, the following are equivalent:

  • (a) ‖Ax−b‖≤‖Az−b‖ for every z∈Fn;
  • (b) Ax=PUb;
  • (c) A∗Ax=A∗b.

Moreover such an x always exists. A vector satisfying these conditions is called a least-squares solution of Ax=b, and the equations in (c) are the normal equations.

Idea. Condition (a) is a minimization over x; condition (b) is the same minimization rewritten in Fm, where Theorem 11.3.5 has already solved it. So (a) ⇔ (b) is a translation, not an argument. The content is (b) ⇔ (c): saying Ax=PUb is the same as saying the residual is perpendicular to U, and “perpendicular to every column of A” is what A∗(b−Ax)=0 says. Existence is free, because PUb lies in U=col(A) and so is Ax for some x.

Proof. Since {Az:z∈Fn}=col(A)=U (Theorem 0.9.3), condition (a) says that Ax is a vector of U at least as close to b as every other vector of U. By Theorem 11.3.5 the unique such vector is PUb. Hence (a) ⇔ (b).

  • (b) ⇔ (c). Write b=PUb+(b−PUb), the splitting of Theorem 11.3.2 (a) with b−PUb∈U⊥. For x∈Fn we have Ax∈U, so b−Ax∈U⊥ holds if and only if Ax is the U-part of b, that is, if and only if Ax=PUb. It remains to see that b−Ax∈U⊥⟺A∗Ax=A∗b. Put r=b−Ax. By Proposition 11.3.1, r∈U⊥ if and only if r is orthogonal to every Az, and by Lemma 11.4.1, ⟨r,Az⟩=⟨A∗r,z⟩for every z∈Fn. If A∗r=0, all these vanish. Conversely, if all vanish, take z=A∗r to get ⟨A∗r,A∗r⟩=0, hence A∗r=0 by positive definiteness. So r∈U⊥ if and only if A∗r=0, which rearranges to A∗Ax=A∗b.

Existence. PUb∈U=col(A), so PUb=Ax for some x∈Fn, and that x satisfies (b).

Three things are worth extracting. The normal equations are a square n×n system, whatever the shape of A. They are always consistent, by the existence clause, even when Ax=b is not. And the minimizing value Ax is unique — it is PUb — even if the minimizing x is not.

Warning. “Closest” is measured by the inner product, so the answer moves when the inner product does. Least squares is not a coordinate-free notion: it minimizes ‖Ax−b‖ for a particular norm on Fm, and rescaling one coordinate — reporting one measurement in centimeters instead of meters, say — is a change of inner product. Concretely, for the data (0,2),(1,1),(2,8) the least-squares line is y=23+3t; if the middle point is trusted twice as much, so that the second coordinate of F3 is weighted by 2, the best line becomes y=3t. Both are correct answers to their own question, and Exercise C1 works the general case out. Before fitting, decide which errors count equally.

Quick check. The system Ax=b may have no solution at all, yet the normal equations A∗Ax=A∗b always have one. Where does the proof arrange that, and what stops the same argument from solving Ax=b itself?

Solution. The existence clause uses that PUb lies in U=col(A), and every vector of col(A) is Ax for some x. So the normal equations ask Ax to hit PUb, a target that is inside the column space by construction. The original system asks Ax to hit b, which need not be in col(A) at all. Projecting first is exactly the step that moves the target into reach; what is given up is the requirement r=0, which becomes r⊥col(A).

11.4.3. When is the least-squares solution unique?

The minimizers of ‖Ax−b‖ are the solutions of the normal equations, so they form the solution set of a linear system: a coset x0+nul(A∗A) (Theorem 3.1.3). To read off uniqueness we therefore need nul(A∗A), and the following small lemma computes it.

Lemma 11.4.3 (The null space of A∗A)

Let A∈Mm×n(F). Then nul(A∗A)=nul(A).

Proof. (⊇) If Ax=0, then A∗Ax=A∗0=0.

(⊆) Suppose A∗Ax=0. Pair with x and move A∗ across using Lemma 11.4.1: 0=⟨A∗(Ax),x⟩=⟨Ax,Ax⟩=‖Ax‖2. Hence Ax=0 by positive definiteness. This proves the lemma.

This is the “pair it with itself” move once more, and it is the whole reason the normal equations behave well. It will return in Section 6 in the form ker(T∗T)=kerT for a linear map T between inner product spaces, with the same two-line proof; the matrix statement above is the case we need now.

Corollary 11.4.4 (Uniqueness of the least-squares solution)

Let A∈Mm×n(F) and b∈Fm. The following are equivalent:

  • (a) Ax=b has exactly one least-squares solution (for one, equivalently for every, b);
  • (b) the columns of A are linearly independent, that is rankA=n;
  • (c) A∗A is invertible.

In that case the least-squares solution is x=(A∗A)−1A∗b.

Proof. By Theorem 11.4.2 the least-squares solutions are the solutions of A∗Ax=A∗b, a consistent system; by Theorem 3.1.3 its solution set is a coset of nul(A∗A), which is nul(A) by Lemma 11.4.3. So the solution is unique, for one b or for all, exactly when nul(A)={0}. Now nul(A)={0} says precisely that the only vanishing linear combination of the columns of A is the trivial one, that is, that the columns are independent; and by Theorem 3.5.7 this is the same as rankA=n. This proves (a) ⇔ (b).

  • (b) ⇔ (c). The matrix A∗A is n×n, so it is invertible if and only if nul(A∗A)={0} (Theorem 3.4.4). By Lemma 11.4.3 this happens exactly when nul(A)={0}.

Finally, if A∗A is invertible, multiplying the normal equations on the left by (A∗A)−1 gives the stated formula.

Warning. (A∗A)−1 is not A−1(A∗)−1. The rule (BC)−1=C−1B−1 needs B and C to be invertible, and in least squares A is usually not even square. Take A=(101101),A⊤A=(2112),(A⊤A)−1=13(2−1−12). The left side exists; the symbols A−1 and (A⊤)−1 do not exist at all, since A is 3×2. The formula x=(A∗A)−1A∗b must be read as one object (A∗A)−1 applied to A∗b, never simplified.

11.4.4. Fitting a line and a parabola

Example (The least-squares line through four points)

Find the line y=c+dt that minimizes the sum of the squared vertical errors at the four data points (1,3),(2,1),(3,5),(4,5). Compute the residual and the minimum value of the sum of squares.

Solution. Asking for c+dti=yi at the four points is the system Ax=b with A=(11121314),x=(cd),b=(3155), and ‖Ax−b‖2 is exactly the sum of the squared vertical errors. The columns of A are independent (they are not multiples of each other), so Corollary 11.4.4 gives a unique answer. Over R, A∗=A⊤, and A⊤A=(4101030),A⊤b=(3+1+5+53+2+15+20)=(1440). The normal equations 4c+10d=14, 10c+30d=40 simplify to 2c+5d=7 and c+3d=4; subtracting twice the second from the first gives −d=−1, so d=1 and c=1. The least-squares line is y=1+t. Its values at t=1,2,3,4 are 2,3,4,5, so the residual is r=b−Ax=(3,1,5,5)−(2,3,4,5)=(1,−2,1,0), and the minimum sum of squares is ‖r‖2=1+4+1+0=6.

Check. The residual must be orthogonal to both columns of A: 1−2+1+0=0 and 1−4+3+0=0. Both hold, which confirms the normal equations.

The same machinery fits any linear combination of prescribed functions; only the columns of A change. “Linear” refers to the unknown coefficients, not to the shape of the curve.

Example (The least-squares parabola)

Find the quadratic y=a+bt+ct2 minimizing the sum of squared errors at (−2,7),(−1,6),(0,2),(1,0),(2,5).

Solution. Now A has columns (1,1,1,1,1), (ti) and (ti2): A=(1−241−11100111124),b=(76205). Because the nodes are symmetric about 0, every odd power sums to zero: ∑ti=0 and ∑ti3=0. With ∑ti2=10 and ∑ti4=34, A⊤A=(5010010010034),A⊤b=(20−1054). The middle equation decouples: 10b=−10, so b=−1. The outer two are 5a+10c=20 and 10a+34c=54; the first gives a=4−2c, and substituting gives 40+14c=54, so c=1 and a=2. The least-squares parabola is y=2−t+t2. Its values at the nodes are 8,4,2,2,4, so r=(−1,2,0,−2,1) and the minimum sum of squares is ‖r‖2=1+4+0+4+1=10.

Check. ∑ri=0, ∑tiri=2−2+0−2+2=0, and ∑ti2ri=−4+2+0−2+4=0: the residual is orthogonal to all three columns.

Two practical remarks. Choosing the nodes symmetrically, as above, made A⊤A nearly diagonal and the arithmetic painless; the same trick appears again in Section 9 when the columns are trigonometric functions. And although the normal equations are the right way to understand least squares, they are not always the right way to compute it: Section 8 solves the same problem through a QR factorization, which avoids forming A∗A at all.

11.4.5. The minimum-norm solution

Now the opposite situation: Ax=b is consistent, but A has a nontrivial null space, so the solutions form an infinite family x0+nul(A) (Theorem 3.1.3). Which one should we report? Orthogonality answers.

Theorem 11.4.5 (Minimum-Norm Solution)

Let A∈Mm×n(F) and let b∈Fm be such that Ax=b is consistent. Write K=nul(A). Then:

  • (a) exactly one solution xmin of Ax=b lies in K⊥;
  • (b) ‖xmin‖<‖x‖ for every other solution x.

We call xmin the minimum-norm solution.

Idea. The solution set is a coset x0+K, and Fn=K⊕K⊥. Throwing away the K-part of x0 keeps it a solution, because that part is in the kernel, and lands it in K⊥. Once there, Pythagoras compares it with every other solution: the others differ from it by a kernel vector, which is perpendicular to it and only adds length.

Proof.

  • (a) Existence. Let x0 be any solution. Since K is a subspace of the finite-dimensional space Fn, Theorem 11.3.2 (a) gives Fn=K⊕K⊥; write x0=k+xmin with k∈K and xmin∈K⊥. Then Axmin=Ax0−Ak=b−0=b, so xmin is a solution lying in K⊥.

    Uniqueness. If xmin and y are solutions in K⊥, then A(xmin−y)=0, so xmin−y∈K∩K⊥={0} by Theorem 11.3.2 (a).

  • (b) Every solution has the form x=xmin+k with k∈K, by Theorem 3.1.3. Since xmin∈K⊥ and k∈K, the two are orthogonal, and Theorem 11.1.3 gives ‖x‖2=‖xmin‖2+‖k‖2. If x≠xmin, then k≠0, so ‖k‖2>0 and ‖x‖>‖xmin‖. This proves the theorem.

The subspace K⊥ has a matrix description that makes xmin computable. For x∈Fn, x∈col(A∗)⊥⟺⟨x,A∗y⟩=0  for all y∈Fm⟺⟨Ax,y⟩=0  for all y∈Fm⟺Ax=0, where the first step is Definition 11.3.1 together with col(A∗)={A∗y:y∈Fm} (Theorem 0.9.3), the second is Lemma 11.4.1, and the last uses the choice y=Ax with positive definiteness. So nul(A)=col(A∗)⊥, and applying ⊥ once more (Theorem 11.3.2 (b)) gives (nul(A))⊥=col(A∗). In words: the minimum-norm solution is the unique solution that is a combination of the columns of A∗, that is, of the conjugated rows of A. Section 6 proves the same statement for linear maps, together with the three companion identities that make up the four fundamental subspaces.

Example (A minimum-norm solution)

Find the solution of smallest norm of {x1+x2+x3=3,x1+2x2+3x3=7.

Solution. Here A=(111123). Subtracting the first equation from the second gives x2+2x3=4, so x2=4−2x3 and then x1=3−x2−x3=x3−1. With t=x3 the solutions are x(t)=(−1,4,0)+t(1,−2,1),t∈R, so K=nul(A)=span((1,−2,1)). By Theorem 11.4.5 the answer is the unique t with x(t)⊥(1,−2,1): ⟨x(t),(1,−2,1)⟩=(−1+t)−2(4−2t)+t=6t−9=0,t=32. Hence xmin=(12,1,32), with ‖xmin‖2=14+1+94=72.

Check. It is a solution, since 12+1+32=3 and 12+2+92=7, and it is orthogonal to the kernel, since 12−2+32=0. By the identity (nulA)⊥=col(A⊤) above it must also be a combination of the rows of A, and it is: xmin=12(1,2,3), half the second row. Finally, the solution x(0)=(−1,4,0) has ‖x(0)‖2=17>72, as Theorem 11.4.5 (b) requires.

The two answers of this section — the least-squares solution and the minimum-norm solution — are usually wanted together: given any A and b, first minimize ‖Ax−b‖, then among the minimizers take the shortest. Chapter 13 packages the combined answer as a single matrix, the pseudoinverse A+, with x=A+b in all cases at once.

11.4.6. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define a least-squares solution of Ax=b, and write down the normal equations.
  • (b) True or false: if Ax=b is consistent, then its solutions are exactly its least-squares solutions. Justify your answer.
  • (c) Explain in one sentence why the normal equations are always consistent.
  • (d) Give a condition on the columns of A equivalent to uniqueness of the least-squares solution.
  • (e) Where does the minimum-norm solution of a consistent system live, and why is it unique there?
  • (f) True or false: (A∗A)−1=A−1(A∗)−1. Justify your answer.

Solution.

  • (a) A vector x∈Fn with ‖Ax−b‖≤‖Az−b‖ for every z∈Fn. The normal equations are A∗Ax=A∗b (Theorem 11.4.2).

  • (b) True. If Ax0=b then ‖Ax0−b‖=0, which is the smallest possible value, so x0 is a least-squares solution; conversely a least-squares solution x has ‖Ax−b‖≤0, hence Ax=b. Least squares extends the notion of a solution without changing it when solutions exist.

  • (c) Because the target Pcol(A)b lies in col(A) by construction, so Ax=Pcol(A)b is solvable (Theorem 11.4.2, existence).

  • (d) The columns are linearly independent, equivalently rankA=n, equivalently A∗A is invertible (Corollary 11.4.4).

  • (e) In (nulA)⊥=col(A∗). Two solutions there would differ by an element of nul(A)∩(nulA)⊥={0} (Theorem 11.4.5).

  • (f) False, and usually meaningless: A need not be square, so A−1 need not exist, while (A∗A)−1 can exist perfectly well — see the 3×2 example in the warning after Corollary 11.4.4.

B. Practice

Exercise (B1: A least-squares line)

Find the least-squares line y=c+dt for the data (0,3),(1,2),(2,3),(3,6). Compute the residual, verify that it is orthogonal to both columns of A, and give the minimum sum of squares.

Solution. With A having columns (1,1,1,1) and (0,1,2,3) and b=(3,2,3,6), A⊤A=(46614),A⊤b=(140+2+6+18)=(1426). The normal equations are 2c+3d=7 and 3c+7d=13. Multiplying the first by 3 and the second by 2 and subtracting gives 9d−14d=21−26, so d=1, and then c=2. The line is y=2+t.

Its values at t=0,1,2,3 are 2,3,4,5, so r=(1,−1,−1,1). Orthogonality: 1−1−1+1=0 against the first column and 0−1−2+3=0 against the second. The minimum sum of squares is ‖r‖2=4.

Exercise (B2: A least-squares parabola)

Find the least-squares quadratic y=a+bt+ct2 for the data (−1,2),(0,8),(1,6),(2,16), and the minimum sum of squares. Hint: write down A⊤A from the power sums ∑tik, k=0,…,4.

Solution. The power sums are ∑1=4, ∑ti=2, ∑ti2=6, ∑ti3=8, ∑ti4=18, so A⊤A=(4262686818),A⊤b=(2+8+6+16−2+0+6+322+0+6+64)=(323672). Solving: from the first two equations, 2a+b+3c=16 and a+3b+4c=18; eliminating a gives 5b+5c=20, so b+c=4. The third equation is 3a+4b+9c=36. Substituting b=4−c into 2a+b+3c=16 gives 2a+2c=12, so a=6−c; then 3(6−c)+4(4−c)+9c=36 becomes 34+2c=36, so c=1, b=3, a=5. The parabola is y=5+3t+t2. Its values at t=−1,0,1,2 are 3,5,9,15, so r=(−1,3,−3,1) and the minimum sum of squares is 1+9+9+1=20. Check: ∑ri=0, ∑tiri=1+0−3+2=0, ∑ti2ri=−1+0−3+4=0.

Exercise (B3: A minimum-norm solution)

Find the minimum-norm solution of {x1+x3=2,x2+x3=3, and verify that it is orthogonal to nul(A).

Solution. With x3=t the solutions are x(t)=(2−t, 3−t, t)=(2,3,0)+t(−1,−1,1), so nul(A)=span((−1,−1,1)). By Theorem 11.4.5 we need ⟨x(t),(−1,−1,1)⟩=0: −(2−t)−(3−t)+t=3t−5=0,t=53. So xmin=(13,43,53), with ‖xmin‖2=1+16+259=143. It solves the system, since 13+53=2 and 43+53=3, and −13−43+53=0 confirms the orthogonality. For comparison, ‖(2,3,0)‖2=13>143.

C. Going deeper

Exercise (C1: Weighted least squares)

Let A∈Mm×n(R), b∈Rm, and let w1,…,wm>0 be weights, with W=diag(w1,…,wm).

  • (a) Show that ⟨x,y⟩W=y⊤Wx is an inner product on Rm.
  • (b) Prove that the minimizers of ∑i=1mwi((Ax)i−bi)2 are exactly the solutions of A⊤WAx=A⊤Wb.
  • (c) For the data (0,2),(1,1),(2,8) with weights (1,2,1), find the weighted least-squares line, and compare it with the unweighted one.

Solution.

  • (a) It is bilinear and symmetric because y⊤Wx=∑iwixiyi, and ⟨x,x⟩W=∑iwixi2>0 whenever some xi≠0, because every wi>0. (This is where positivity of the weights is used; a zero weight would destroy definiteness.)

  • (b) Write ‖⋅‖W for the norm induced by ⟨⋅,⋅⟩W. The quantity to minimize is exactly ‖Ax−b‖W2. The proof of Theorem 11.4.2 used nothing about the inner product except its axioms, so it applies verbatim with ⟨⋅,⋅⟩W in place of the standard one: the minimizers are the x for which Ax−b is ⟨⋅,⋅⟩W-orthogonal to col(A), that is, for which ⟨Ax−b,Az⟩W=0 for all z∈Rn. Now ⟨Ax−b,Az⟩W=(Az)⊤W(Ax−b)=z⊤(A⊤WAx−A⊤Wb), and this vanishes for all z∈Rn exactly when A⊤WAx−A⊤Wb=0, by taking z equal to that vector.

  • (c) With A having columns (1,1,1) and (0,1,2), b=(2,1,8) and W=diag(1,2,1), A⊤WA=(4446),A⊤Wb=(2+2+80+2+16)=(1218), so 4c+4d=12 and 4c+6d=18, giving d=3 and c=0: the weighted line is y=3t. Unweighted, A⊤A=(3335) and A⊤b=(11,17), giving 3c+3d=11, 3c+5d=17, so d=3 and c=23: the unweighted line is y=23+3t. The middle point is trusted twice as much in the weighted fit, and the line moves down to pass closer to it. The weighted fit has weighted error 4+2⋅4+4=16, smaller than the weighted error 1609 of the unweighted line, while the unweighted fit has plain error 323, smaller than the plain error 12 of the weighted line: each line wins the contest it was designed for.

Exercise (C2: The residual, two ways)

Let x be a least-squares solution of Ax=b and let r=b−Ax.

  • (a) Prove that ‖r‖2=‖b‖2−‖Ax‖2, and also that ‖r‖2=⟨b,r⟩=‖b‖2−⟨A∗b,x⟩.
  • (b) Use the second formula to recompute the minimum sum of squares in Example (The least-squares line through four points) without finding the residual vector.

Solution.

  • (a) By Theorem 11.4.2, Ax=PUb with U=col(A), so r=b−PUb∈U⊥ while Ax∈U. The two are orthogonal, and b=Ax+r, so Theorem 11.1.3 gives ‖b‖2=‖Ax‖2+‖r‖2, which is the first identity.

    For the second, ⟨b,r⟩=⟨Ax+r,r⟩=⟨Ax,r⟩+‖r‖2=‖r‖2, since ⟨Ax,r⟩=⟨r,Ax⟩―=0 by orthogonality. Expanding the other way, and using Lemma 11.4.1, ⟨b,r⟩=⟨b,b−Ax⟩=‖b‖2−⟨b,Ax⟩=‖b‖2−⟨A∗b,x⟩.

  • (b) In Example (The least-squares line through four points), ‖b‖2=9+1+25+25=60, A⊤b=(14,40) and x=(1,1), so ‖r‖2=60−⟨(14,40),(1,1)⟩=60−54=6, matching the value found there. Only the data already assembled for the normal equations is needed.
Exercise (C3: A rank-deficient least-squares problem)

Let A=(101011112),b=(120).

  • (a) Show that Ax=b is inconsistent and that rankA=2.
  • (b) Describe all least-squares solutions.
  • (c) Find the one of smallest norm, and the minimum sum of squares.

Solution.

  • (a) The third column is the sum of the first two, so the columns are dependent and rankA≤2; the first two columns are independent, so rankA=2 and col(A)=span((1,0,1),(0,1,1)). A vector (b1,b2,b3) lies in col(A) exactly when b3=b1+b2; here 0≠1+2, so b∉col(A) and the system is inconsistent.

  • (b) By Theorem 11.4.2 the least-squares solutions solve A⊤Ax=A⊤b. Here A⊤A=(213123336),A⊤b=(123). Row reducing, the third row is the sum of the first two, and subtracting suitable multiples gives x1+x3=0 and x2+x3=1. Hence x(t)=(0,1,0)+t(−1,−1,1),t∈R, a coset of nul(A)=span((−1,−1,1))=nul(A⊤A), as Lemma 11.4.3 predicts.

  • (c) The minimizers form a coset of nul(A), so the argument of Theorem 11.4.5 applies to it verbatim: the shortest is the one orthogonal to (−1,−1,1). From −(−t)−(1−t)+t=3t−1=0 we get t=13 and xmin=(−13,23,13),‖xmin‖2=1+4+19=23. Every minimizer gives the same Ax=(0,1,1)=Pcol(A)b, with residual r=(1,1,−1) and minimum sum of squares ‖r‖2=3. Check: r is orthogonal to (1,0,1) and to (0,1,1), since 1−1=0 and 1−1=0.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.