QR Factorization

  • numerical method (standard) for LS probs

  • properties of QR

  • numerical benefits

  • computation

In general, (a,b)2=(a,b)T(a,b)=aTa+bTb=a2+b2\lVert(a,b)\rVert^2=(a,b)^T(a,b)=a^Ta+b^Tb=\lVert a\rVert^2+\lVert b\rVert^2

Linear Least Squares

min12Axb22\min \frac{1}{2}\lVert Ax-b\rVert^2_2

if A has full col rank (m>nm>n) then XLSX_{LS} uniquely solves Normal Equation’s

ATAxLS=ATbA^TAx_{LS} = A^Tb

xLS=(ATA)1ATbx_{LS} = (A^TA)^{-1}A^Tb

yˉ=AxLS=A(ATA)1ATb\bar{y}=Ax_{LS}=A(A^TA)^{-1}A^Tb (projector onto range(A)range(A))

“Conditioning” of a matrix determines the accuracy of a linear system solve: cond(M)=λmax(M)λmin(M)cond(M)=\frac{\lambda_{max}(M)}{\lambda_{min}(M)}

If MM is not square:

cond(M)=max(M)min(M)cond(M)=\frac{\nabla{max}(M)}{\nabla{min}(M)}, where \nabla is the gradient

For M=ATAM = A^TA, (M)=(ATA)=(A)2\nabla(M) = \nabla(A^TA)=\nabla(A)^2

λi(ATA)=i(A)2\lambda_i(A^TA)=\nabla_i(A)^2

With QQ be orthogonal basis for range(A)range(A)

QTn×mQm×n=In×n\underbrace{Q^T}_{n \times m}\underbrace{Q}_{m \times n}=\underbrace{I}_{n\times n}

PP is an orthogonal projector onto range(P)range(P) if

  1. P2=PP^2=P idempotent

  2. P=PTP=P^T symmetric

Take P=QQTP=QQ^T: range(P)=range(Q)=range(A)range(P)=range(Q)=range(A)

P2=QQTQQT=QQT=PP^2=QQ^TQQ^T=QQ^T=P

range(Q)=range(A)range(Q) = range(A)

Q=[q1,q2,,qn]Q=[q_1,q_2,…,q_n]

span{q1,,qn}=span{a1,,an}span\{q_1,…,q_n\}=span\{a_1,…,a_n\}

Every matrix Am×nA_{m\times n} has a QR Factorization:

A=Q[R0]A=Q\begin{bmatrix} R \\ 0 \end{bmatrix}, where QQ is orthogonal (QQT=QTQ=IQQ^T=Q^TQ=I) and R=upper triangular

QQ is orthogonal (and square)

QTQ=QTQ=ImQ^TQ=Q^TQ=I_m

Q1Q_1 is orthonormal (not orthogonal)

Q1TQ1=InQ_1^TQ_1=I_n

Q1Q1TImQ_1Q_1^T \ne I_m

orthonormal matrices are rotations:

  1. for any vector xRnx \in \R^n, Q1x2=x2\lVert Q_1x\rVert_2=\lVert x\rVert_2Q1x2=xTQ1TQ1x=xTx=x2\lVert Q_1x\rVert^2=x^TQ_1^TQ_1x=x^Tx=\lVert x\rVert^2

  2. any yRmy \in \R^m, (Qx)T(Qy)=xTQTQy=xTy(Qx)^T(Qy)=x^TQ^TQy=x^Ty

Solving Least Squares

minxAxb2\underset{x}{\min}\lVert Ax-b\rVert^2

Axb2=QT(Axb)2=QTAxQTb2=[Rx0][Q1TbQ2Tb]2=RxQTb2+Q2Tb2 \begin{aligned} \lVert Ax-b \rVert ^2 &=\lVert Q^T(Ax-b)\rVert ^2 \\ &=\lVert Q^TAx-Q^Tb\rVert ^2 \\ &=\lVert \begin{bmatrix} Rx\\ \hdashline \\ 0\end{bmatrix}-\begin{bmatrix} Q^T_1b\\ \hdashline \\ Q^T_2 b\end{bmatrix}\rVert ^2 \\ &= \lVert Rx-Q^Tb\rVert^2+\lVert Q^T_2b\rVert^2\end{aligned}

A=Q[R0]A = Q\begin{bmatrix}R \\ 0\end{bmatrix}

Multiply both sides on the left with QTQ^T

QTA=QTQI[R0]Q^TA=\underbrace{Q^TQ}_I\begin{bmatrix}R\\0\end{bmatrix}

[Q1TAQ2TA]=[R0]\begin{bmatrix}Q^T_1A\\Q_2^TA\end{bmatrix}=\begin{bmatrix}R\\0\end{bmatrix}

Q1TA=RQ_1^TA=R

Q2TA=0Q_2^TA=0

R1x=Q1TbR_1x=Q_1^Tb ⇒ solving least squares using QR

Cond(A)=Cond(Q,R)=Cond(R)\begin{aligned}Cond(A) &= Cond(Q,R)\\ &= Cond(R)\end{aligned}

Last updated