QR Factorization Continued

Observation: If A is an m × n matrix and A = QR is the QR factorization of A, then if m n then QQT = I while if m ≥ n then QTQ = I. Thus, if A is a square matrix, then A = QR where Q is orthogonal, i.e. QTQ = I and QQT = I. If A is not a square matrix, then Q is only partially orthogonal.

For example, in Figure 1 we display the QR factorization of the 3 × 2 matrix A. As expected, QTQ = I but QQT ≠ I.

Reduced QR factorization

Figure 1 – QR factorization (reduced)

Observation: There is another version of the QR factorization of A, which we will refer to as the full QR factorization (with the previous version referred to as the reduced QR factorization). In this case, A = QR where A is an m × n matrix, Q is an m × m square matrix and R is an m × n upper triangular matrix. In this version, Q is indeed orthogonal.

Figure 2 displays the full QR factorization of the A matrix from Figure 1.

Full QR Factorization

Figure 2 – QR factorization (full)

Note that for square matrices the full and reduced QR factorizations are the same.

Real Statistics Excel Functions: The Real Statistics Resource Pack provides the following array functions, where R1 is an m × n range in Excel

QRFullR(R1, prec): outputs the m × n upper triangular array R for which A = QR where A is the matrix in R1.

QRFullQ(R1, prec): outputs the m × m array Q for which A = QR where A is the matrix in R1.

QRFull(R1, prec): outputs an m × m+n array. The first m columns of the output is Q and the next n columns of the output is R where A = QR and A is the matrix in range R1.

In Figure 2, range D12:F14 contains the formula =QRFullQ(A12:B14) and H12:I14 contains the formula =QRFullR(A12:B14).

The example in Figure 2 is for an m × n matrix where m > n. For an m × n matrix A where m < n, the roles of the full and reduced QR factorizations are reversed. The QRFactorQ function actually produces the version of Q that is orthogonal and QRFullQ produces the version that is partially orthogonal.

QR Factorization m<n

Figure 3 – QR factorization for a matrix where m < n

In Figure 3 the QR factorization based on QRFactorQ and QRFactorR is shown above the version using QRFullQ and QRFullR. Note that the output from =QRFull(A12:C13) looks like the contents of range E12:K13 with columns G and H removed.

Leave a Comment