MATH 323 Lecture 23

From Notes
Jump to navigation Jump to search

« previous | Tuesday, November 20, 2012 | next »


Least Squares Problem

given a m×n matrix A with rank n, the least-squares solution to the equation Ax=b is given by

ATAx=ATb

and has the unique solution

x^=(ATA)1ATb

the vector pAx in the range of A is closest to b.

Assume the columns of A constitute an orthonormal basis in R(A).

Theorem 5.5.6

If the column vectors of A form an orthonormal set of vectors in m, then ATA=I and the solution to the least squares problem is

x^=ATb

Proof

We need to show that ATA=I.

If ATA=(cij), then cij=aiaj=δij={1i=j0otherwise

Therefore, the diagonal entries for

i=j

will be 1, and all other matrix cells will be 0.

Q.E.D.

Theorem 5.5.7

Let S be a subspace in (V,,) and let xV.

Let dimS=n and {x1,,xn} be an orthonormal basis for S.

If p=i=1ncixi where ci=x,xi for all i, then pxS.

Proof

Show that (px)xi for any i:

px,xi=j=1ncjxj,xix,xi=j=1ncjxj,xix,xi=j=1ncjδijx,xi=cixi,xici=cici=0

Theorem 5.5.8

Under hypothesis of #Theorem 5.5.7, p is the element of S that is closest to x. That is, yx>px for all yp in S.

Corollary 5.5.9

Let S be a nonzero subspace in m and let pm.

If \{\vec{u}_1, \ldots, \vec{u}_k \} is an orthonormal basis for S and U=(u1,,uk), then the projection p of b onto S is given by \vec{p} = UU^T \vec{b}</math>

Proof

p=i=1kciui=Uc=UUTb

c=(u1TbukTb)=UTb

Let P=UUT be the projection matrix for S.

Going back to the formula for the least squares solution, x^=(ATA)1ATb, P=(ATA)1AT

P is unique to S regardless of basis used. However, P=UUT can only be used for orthonormal bases; other calculations must use P=(ATA)1AT


Example

Find best least squares approximation of ex on [0,1] by a linear function (subspace of C[0,1])

  • Space: C[0,1]
  • Inner product: f,g=01f(x)g(x)dx
  • Subsace: S=Span{1,x} (linear functions)

Find a such that (xa)1:

1,xa=01(xa)dx=12a=0

Therefore a=12, and {1,x12} forms an orthogonal basis for S.


Find orthonormal basis for S:

x12=01(x12)2dx=1121=1u1=1u2=x12x12=12(x12)

Therefore {1,12(x12)} forms an orthonormal basis for S


Find least squares approximation:

p=c1u1+c2u2c1=ex,u1=01exdx=e1c2=ex,u2=01ex(x12)dx=3(3e)p=(e1)1+(3(e3))(12(x12))=(4e10)+(6(3e))x

Fourier Approximation

rk=ak2+bk2θk=arctan(bkak)akcoskx+bksinkx=rkcoskxθk

The last formula is the equation for harmonic motion.

Gram-Schmidt Process

For V,,, and {x1,,xn} basis in V,

How do we obtain {u1,,un}, an orthonormal basis for S so that Span{x1,,xn}=Span{u1,,un}?

u1=x1x1Span{x1}=Span{u1}=V1p1=projV1(x2)=x2,u1u1x2p1V1u2=x2p1x2p1Span{x1,x2}=Span{u1,u2}=V2p2=projV1(x3)=x3,u2u2x3p2V2

Theorem 5.6.1

Let {x1,,xn} be a basis for V,,. Let u1=x1x1 and define u2,,un recursively by

uk+1=xk+1pkxk+1pk

Where pk=xk+1,u1u1+xk+1,u2u2++xk+1,ukuk is the projection of xk+1 onto vk=Span(u1,,uk)=Span(x1,,xk).

The set {u1,,un} is an orthonormal basis for V.