06.09.2021 Views

Linear Algebra, Theory And Applications, 2012a

Linear Algebra, Theory And Applications, 2012a

Linear Algebra, Theory And Applications, 2012a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

12.5. LEAST SQUARES 297<br />

Lemma 12.5.1 Let V and W be finite dimensional inner product spaces and let A : V → W<br />

be linear. For each y ∈ W there exists x ∈ V such that<br />

|Ax − y| ≤|Ax 1 − y|<br />

for all x 1 ∈ V. Also, x ∈ V is a solution to this minimization problem if and only if x is a<br />

solution to the equation, A ∗ Ax = A ∗ y.<br />

Proof: By Theorem 12.2.4 on Page 291 there exists a point, Ax 0 , in the finite dimensional<br />

subspace, A (V ) , of W such that for all x ∈ V,|Ax − y| 2 ≥|Ax 0 − y| 2 . Also, from<br />

this theorem, this happens if and only if Ax 0 − y is perpendicular to every Ax ∈ A (V ) .<br />

Therefore, the solution is characterized by (Ax 0 − y, Ax) = 0 for all x ∈ V which is the<br />

same as saying (A ∗ Ax 0 − A ∗ y, x) = 0 for all x ∈ V. In other words the solution is obtained<br />

by solving A ∗ Ax 0 = A ∗ y for x 0 . <br />

Consider the problem of finding the least squares regression line in statistics. Suppose<br />

you have given points in the plane, {(x i ,y i )} n i=1<br />

and you would like to find constants m<br />

and b such that the line y = mx + b goes through all these points. Of course this will be<br />

impossible in general. Therefore, try to find m, b such that you do the best you can to solve<br />

the system<br />

⎛ ⎞ ⎛ ⎞<br />

y 1 x 1 1 ( )<br />

⎜ . ⎟ ⎜<br />

⎝<br />

⎠ =<br />

⎟ m<br />

⎝ . . ⎠<br />

b<br />

y n x n 1<br />

⎛ ⎞<br />

2<br />

( ) y 1<br />

m ⎜<br />

which is of the form y = Ax. In other words try to make<br />

A −<br />

b<br />

⎝<br />

⎟<br />

. ⎠<br />

as small<br />

∣<br />

y n<br />

∣<br />

as possible. According to what was just shown, it is desired to solve the following for m and<br />

b.<br />

⎛ ⎞<br />

( ) y 1<br />

A ∗ m<br />

A = A ∗ ⎜<br />

b<br />

⎝<br />

⎟<br />

. ⎠ .<br />

y n<br />

Since A ∗ = A T in this case,<br />

( ∑ n<br />

∑i=1 x2 i n<br />

i=1 x i<br />

∑ n<br />

i=1 x )(<br />

i m<br />

n b<br />

Solving this system of equations for m and b,<br />

)<br />

=<br />

( ∑ n<br />

i=1 x iy i ∑n<br />

i=1 y i<br />

m = − (∑ n<br />

i=1 x i)( ∑ n<br />

i=1 y i)+( ∑ n<br />

i=1 x iy i ) n<br />

( ∑ n<br />

i=1 x2 i ) n − (∑ n<br />

i=1 x i) 2<br />

and<br />

b = − (∑ n<br />

i=1 x i) ∑ n<br />

i=1 x iy i +( ∑ n<br />

i=1 y i) ∑ n<br />

i=1 x2 i<br />

( ∑ n<br />

i=1 x2 i ) n − (∑ n<br />

i=1 x i) 2 .<br />

One could clearly do a least squares fit for curves of the form y = ax 2 + bx + c in the<br />

same way. In this case you solve as well as possible for a, b, and c the system<br />

using the same techniques.<br />

⎛<br />

⎜<br />

⎝<br />

⎞<br />

x 2 1 x 1 1<br />

⎛<br />

.<br />

.<br />

⎟<br />

. ⎠<br />

x 2 n x n 1<br />

⎝ a b<br />

c<br />

⎞ ⎛<br />

⎠ ⎜<br />

= ⎝<br />

y 1<br />

.<br />

y n<br />

⎞<br />

⎟<br />

⎠<br />

)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!