Question

Why QDU solves the projected least squares system

Original question: If you have a coefficient matrix A = QDU and you're trying to solve an inconsistent system AX = B, why is it that solving (QDU)X = B gives you the solution to AX = Proj (B) [onto col(A)]? And why isn't that a true solution to AX = B?

Expert Verified Solution

thumb_up100%(1 rated)

Key takeaway: For an inconsistent linear system, the factorization A = QDU helps separate the column-space geometry from the algebra. The equation (QDU)X = B is not really being solved against the original B in the full space; it is solved after projecting B onto col(A), which is the part A can actually produce.

The key idea: only vectors in col(A) are attainable

If the system AX=BAX=B is inconsistent, that means BB is not in the column space of AA. So there is no vector XX such that AXAX equals the original BB exactly. What the factorization A=QDUA=QDU gives you is a clean way to separate the part of BB that lies inside col(A)\operatorname{col}(A) from the part that lies outside it.

Because the columns of AA span col(A)\operatorname{col}(A), any exact output of AXAX must live in that subspace. If BB has a component orthogonal to col(A)\operatorname{col}(A), that component cannot be matched by any choice of XX.

Why solving (QDU)X=B(QDU)X=B really means solving against the projection

In practice, the QQ factor is orthogonal, so it preserves lengths and angles. The decomposition is arranged so that the action of QDUQDU maps coordinates in the domain into the subspace where the data live. When BB is not in col(A)\operatorname{col}(A), the best you can do is replace BB by its orthogonal projection onto col(A)\operatorname{col}(A):

AX=Projcol(A)(B).AX = \operatorname{Proj}_{\operatorname{col}(A)}(B).

That projected vector is the unique vector in col(A)\operatorname{col}(A) closest to BB. Since every vector of the form AXAX must lie in col(A)\operatorname{col}(A), this is the meaningful target. The factorization lets you solve the reduced, compatible system inside the subspace where a solution actually exists.

Why this is not a true solution to the original system

A true solution to AX=BAX=B would require exact equality with BB, not just the closest vector in the column space. If Bcol(A)B\notin \operatorname{col}(A), then the residual

r=BAXr = B - AX

cannot be zero. Instead, for the least-squares or projected solution, that residual is orthogonal to col(A)\operatorname{col}(A), which is the geometric condition characterizing the best approximation.

So (QDU)X=B(QDU)X=B is only a formal way of writing the computation after you reinterpret the right-hand side as its projection. It does not contradict inconsistency, because the actual solved equation is

AX=Projcol(A)(B),AX = \operatorname{Proj}_{\operatorname{col}(A)}(B),

not AX=BAX=B.

The geometry behind the factorization

The factorization A=QDUA=QDU is useful because it isolates three roles: UU changes coordinates, DD scales along independent directions, and QQ rotates or reflects into the subspace geometry. This makes it easier to see that the system is solvable exactly only for right-hand sides inside the image of AA.

When BB is outside that image, the orthogonal projection is the best possible replacement. That is why the factorization naturally leads to the projected system and to least-squares behavior.


Pitfalls the pros know 👇 A common mistake is to think that writing (QDU)X=B(QDU)X=B automatically means you have solved the original inconsistent system. That is not correct unless BB already lies in col(A)\operatorname{col}(A). Another pitfall is to confuse the algebraic manipulation with the geometric meaning: the factorization does not create a true solution out of nothing. It only makes the closest attainable right-hand side explicit. The residual does not disappear; it becomes the part of BB orthogonal to the column space.

What if the problem changes? If the system were consistent, meaning Bcol(A)B\in\operatorname{col}(A), then the projection would satisfy Projcol(A)(B)=B\operatorname{Proj}_{\operatorname{col}(A)}(B)=B, and solving the factored system would give a true exact solution to AX=BAX=B. A different variant is when you solve the normal equations ATAX=ATBA^TAX=A^TB instead. That formulation also produces the least-squares solution, but it uses the orthogonality condition directly rather than the QDUQDU geometry. In both cases, the computed XX minimizes the error when exact equality is impossible.

Tags: column space projection, least squares solution, orthogonal residual

FAQ

Why does solving the factored system give the projection onto the column space?

Because every vector of the form AX must lie in col(A), the closest attainable right-hand side to an inconsistent B is its orthogonal projection onto col(A). The QDU factorization organizes that projection algebraically and geometrically.

Why is the projected solution not an exact solution to the original linear system?

It is not exact unless B already lies in col(A). When B has a component outside the column space, no choice of X can make AX equal B, so the residual remains nonzero even though it is orthogonal to col(A).

chat