MATH 323 Lecture 21

From Notes
Jump to navigation Jump to search

« previous | Thursday, November 8, 2012 | next »


Least Squares Problem

Given subspace S⊂ℝ and a vector v→∉S, find the closest approximation p→∈S. p→ is a vector projection, and ‖p→‖ is the α-scalar projection.

When represented by Ax→=b→, S=R(A) is the column space of A, and x^ is the vector such that p→=Ax^. We get r(x^)=b→−p→=b→−Ax^ is the residual vector.

Normal Equation

ATAx^=ATb→

Theorem 5.3.2

A is a m×n matrix of rank n (same rank as number of columns). Then the normal equation ATAx→=b→ has a unique solution given by

x^=(ATA)−1ATb→

And x^ is the unique least squares solution to the sysetm Ax→=b→.


Proof

Based on premise that ATA is nonsingular.

Assume we have some vector ATAz→=0→. For ATA to be nonsingular, z=0→ must be the only solution.

We know that

  • Az→∈N(AT)
  • Az→∈R(A)
  • and R(A)⊥N(AT)

Therefore

Az→∈(R(A)∩N(AT))={0→}

.

Q.E.D.

Corollary

We already know that p→=Ax^, and x^=(ATA)−1ATb→, so

p→=A(ATA)−1AT⏟Pb→

The projection matrix P is interesting because P2=P:

P2=A(ATA)−1ATA(ATA)−1AT=A(ATA)−1AT

Example

Overdetermined system

x1+x2=3−2x1+3x2=12x1−x2=2

A=(11−232−1)AT=(1−2213−1)b→=(312)

ATAx→=ATb→

x^=(81507150)

Regression

Given a set of measurements y1,…,yn at points x1,…,xn, each set of values defines a point at (xi,yi).

Linear Regression

Find equation such that y=c0+c1x that approximates the system of equations

[1x11x2⋮⋮1xn][c0c1]=[y1y2⋮yn]

Solution for Ac→=y→ is given by ATAc→=ATy→


Inner Product Spaces

Vector space V. Suppose we have a function such that for all x,y∈V, the inner product of x,y (notation ⟨x,y⟩) is a real number.

We want to have the following properties:

  1. ⟨x,x⟩≥0 and is equal to 0 iff x=0
  2. ⟨x,y⟩=⟨y,x⟩ (commutativity)
  3. ⟨αx+βy,z⟩=α⟨x,z⟩+β⟨y,z⟩ and the same applies for the second component.

Example 1

ℝn, ⟨x→,y→⟩=x→⋅y→ is the scalar product.

Given w→ weights such that wi≥0∀wi∈w→,

⟨x→,y→⟩w→=∑i=1nwixiyi

Example 2

Given two matrices A,B∈Mm,n(ℝ), let ⟨A,B⟩=∑i=1m∑j=1naijbij.

Example 3

Given two functions f,g∈C[a,b], let ⟨f,g⟩=∫abf(x)g(x)dx


  1. ⟨f,f⟩=∫abf2(x)dx≥0 and ⟨f,f⟩=∫abf2(x)dx=0⟺f≡0
  2. …

Properties

Given a vector space V and an inner product function ⟨⋅,⋅⟩

We can redefine:

  • length / norm: ‖V‖=⟨v,v⟩
  • Orthogonality: u⊥v⟺⟨u,v⟩=0
  • Scalar projection: α=⟨u,v⟩‖v‖
  • Vector projection: p=α⋅(1‖v‖v)=⟨u,v⟩⟨v,v⟩v

Theorem 5.4.1

The Pythagorean Law

If u⊥v, then ‖u+v‖2=‖u‖2+‖v‖2

Proof

‖u+v‖2=⟨u+v,u+v⟩=⟨u,u⟩+⟨u,v⟩+⟨v,u⟩+⟨v,v⟩=‖u‖2+0+0+‖v‖2


Orthogonality of Functions

1⊥x, where the inner product is defined as ⟨f,g⟩=∫−11f(x)g(x)dx

⟨1,x⟩=∫−111⋅xdx=0


Theorem 5.4.2

The Cauchy-Schwarz Inequality

|⟨u,v⟩|≤‖u‖‖v‖

Holds iff u and v are linearly dependent.