Can someone tell me what I'm doing wrong? Starting with normal equation for least squares:(adsbygoogle = window.adsbygoogle || []).push({});

(1) A^{T}Ax = A^{T}b

and introducing a diagonal permutation matrix P such that PA = K:

(2) A = P^{-1}K

(3) A^{T}= K^{T}[P^{-1}]^{T}= K^{T}P^{-1}since P is diagonal, P^{T}= P

Substituting (2) and (3) into (1):

(4) (K^{T}P^{-1})(P^{-1}K)x = K^{T}P^{-1}b

(5) K^{T}P^{-1}P^{-1}Kx = K^{T}P^{-1}b

Introducing QR factorzation of K, where Q is orthogonal and R is upper triangular:

(6) K = QR, K^{T}= R^{T}Q^{T}

Equation (5) becomes:

(7) R^{T}Q^{T}P^{-1}P^{-1}QRx = R^{T}Q^{T}P^{-1}b

Pre multiplying both sides by [R^{T}]^{-1}:

(8) Q^{T}P^{-1}P^{-1}QRx = Q^{T}P^{-1}b

Pre-multiplying both sides by Q (QQ^{T}= I since Q is orthogonal):

(9) P^{-1}P^{-1}QRx = P^{-1}b

Pre-multiplying both sizes by P:

(10) P^{-1}QRx = b

Pre-multiplying both sizes by P:

(11) QRx = Pb

Pre-multiplying both sizes by Q^{T}:

(12) Rx = Q^{T}Pb, where PA = K = QR

Since R is upper triangular, x can be solved via back substitution. But, something the wrong the above development because a numerical example doesn't work out correct. The standard QR factorization of the least squares normal equation results in:

(13) R'x = Q'^{T}b, where A = Q'R'

When I solve an actual numerical example, I get different results using (12) and (13). Where did I go wrong? :yuck:

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# QR Factorization

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**