Solving linear equations via the QR decomposition
Basic idea: reduction to triangular systems of equationsConsider the problem of solving a system of linear equations , where and are given. The basic idea in the solution algorithm starts with the observation that in the special case when is upper triangular, that is, if , then the system can be easily solved by a process known as backward substitution. In backward substitution we simply start solving the system by eliminating the last variable first, then proceed to solve backwards. The process is illustrated in this example, and described in generality here. The QR decomposition of a matrixThe QR decomposition allows to express any matrix as the product where is and orthogonal (that is, ) and is upper triangular. For more details on this, see here. Once the QR factorization of is obtained, we can solve the system by first pre-multiplying with both sides of the equation: This is due to the fact that . The new system is triangular and can be solved by backwards substitution. For example, if is full column rank, then is invertible, so that the solution is unique, and given by . Let us detail the process now. Using the full QR decompositionWe start with the full QR decomposition of A with column permutations: where
Using , we can write , where . Let's look at the equation in in expanded form: We see that unless , there is no solution. Let us assume that . We have then which is a set of linear equations in variables. A particular solution is obtained upon setting , which leads to a triangular system in , with an invertible triangular matrix . Hence , which corresponds to a particular solution to : Set of solutionsWe can also generate all the solutions, by noting that is a free variable. We have where The set of solutions is the affine set . |