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 p→∈Ax→ 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=a→i⋅a→j=δ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 x∈V.

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

If p=∑i=1ncixi where ci=⟨x,xi for all i, then p−x∈S⊥.

Proof

Show that (p−x)⊥xi for any i:

⟨p−x,xi⟩=⟨∑j=1ncjxj,xi⟩−⟨x,xi⟩=∑j=1ncj⟨xj,xi⟩−⟨x,xi⟩=∑j=1ncjδij−⟨x,xi⟩=ci⟨xi,xi⟩−ci=ci−ci=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, ‖y−x‖>‖p−x‖ for all y≠p in S.

Corollary 5.5.9

Let S be a nonzero subspace in ℝm and let p∈ℝm.

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

Proof

p→=∑i=1kciu→i=Uc→=UUTb→

c→=(u→1Tb→⋮u→kTb→)=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 (x−a)⊥1:

⟨1,x−a⟩=∫01(x−a)dx=12−a=0

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


Find orthonormal basis for S:

‖x−12‖=∫01(x−12)2dx=112‖1‖=1u1=1u2=x−12‖x−12‖=12(x−12)

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


Find least squares approximation:

p=c1u1+c2u2c1=⟨ex,u1⟩=∫01exdx=e−1c2=⟨ex,u2⟩=∫01ex(x−12)dx=3(3−e)p=(e−1)⋅1+(3(e−3))⋅(12(x−12))=(4e−10)+(6(3−e))x

Fourier Approximation

rk=ak2+bk2θk=arctan⁡(bkak)akcos⁡kx+bksin⁡kx=rkcos⁡kx−θ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=x1‖x1‖Span{x1}=Span{u1}=V1p1=projV1(x2)=⟨x2,u1⟩⋅u1x2−p1⊥V1u2=x2−p1‖x2−p1‖Span{x1,x2}=Span{u1,u2}=V2p2=projV1(x3)=⟨x3,u2⟩⋅u2x3−p2⊥V2…

Theorem 5.6.1

Let {x1,…,xn} be a basis for V,⟨⋅,⋅⟩. Let u1=x1‖x1‖ and define u2,…,un recursively by

uk+1=xk+1−pk‖xk+1−pk‖

Where pk=⟨xk+1,u1⟩u1+⟨xk+1,u2⟩u2+…+⟨xk+1,uk⟩uk is the projection of xk+1 onto vk=Span(u1,…,uk)=Span(x1,…,xk).

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