21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Goal:<br />

Euclidean distance of y ∈ R d from the plane: dist(H,y) = |c + n T y| . (6.2.7)<br />

given the points y 1 ,...,y m , m > d, find H ↔ {c ∈ R,n ∈ R d , ‖n‖ 2 = 1}, such that<br />

m∑<br />

m∑<br />

dist(H,y j ) 2 = |c + n T y j | 2 → min . (6.2.8)<br />

j=1<br />

Note: (6.2.8) ≠ linear least squares problem due to constraint ‖n‖ 2 = 1.<br />

⎛<br />

⎞⎛<br />

⎞<br />

1 y 1,1 · · · y 1,d c<br />

(6.2.8) ⇔<br />

⎜1 y 2,1 · · · y 2,d<br />

⎟⎜n 1<br />

⎟<br />

⎝<br />

. . . ⎠⎝<br />

. ⎠<br />

→ min under constraint ‖n‖ 2 = 1 .<br />

1 y m,1 · · · y m,d n<br />

∥} {{ } d ∥<br />

=:A<br />

2<br />

Step ➊: QR-decomposition (→ Section 2.8)<br />

⎛<br />

⎞<br />

r 11 r 12 · · · · · · r 1,d+1<br />

⎛<br />

⎞<br />

1 y 1,1 · · · y 1,d<br />

0 r 22 · · · · · · r 2,d+1<br />

A := ⎜1 y 2,1 · · · y 2,d<br />

⎟<br />

⎝.<br />

. . ⎠ = QR , R := . ... .<br />

0 r d+1,d+1<br />

∈ R m,d+1 .<br />

1 y m,1 · · · y m,d<br />

⎜ 0 · · · · · · 0<br />

⎟<br />

⎝ .<br />

. ⎠<br />

0 · · · · · · 0<br />

j=1<br />

⎛<br />

⎞<br />

r 11 r 12 · · · · · · r 1,d+1 ⎛ ⎞<br />

0 r 22 · · · · · · r 2,d+1<br />

c<br />

. . .. .<br />

n 1<br />

‖Ax‖ 2 → min ⇔ ‖Rx‖ 2 =<br />

0 r d+1,d+1<br />

⎜ .<br />

⎟<br />

→ min . (6.2.9)<br />

⎜ 0 · · · · · · 0<br />

⎝<br />

⎟<br />

. ⎠<br />

⎝<br />

.<br />

. ⎠ n d ∥ 0 · · · · · · 0 ∥ 2<br />

Step ➋<br />

Note that necessarily (why?)<br />

Ôº¾½ º¾<br />

Note: Since r 11 = ∥ ∥(A) :,1<br />

∥ ∥2 = √ d + 1 ≠ 0 ⇒ c = −r −1<br />

11<br />

MATLAB-function:<br />

For A ∈ K m,n find<br />

n ∈ R d , c ∈ R n−d<br />

such that<br />

( c ∥∥∥2<br />

∥ n)∥ A → min<br />

with the constraint:<br />

‖n‖ 2 = 1 .<br />

6.3 Total Least Squares<br />

d∑<br />

r 1,j+1 n j .<br />

j=1<br />

Code 6.2.5: (Generalized) distance fitting a hyperplane<br />

1 function [ c , n ] = clsq (A, dim ) ;<br />

2 [m, p ] = size (A) ;<br />

3 i f p < dim+1 , error ( ’ not enough unknowns ’ ) ; end ;<br />

4 i f m < dim , error ( ’ not enough equations ’ ) ; end ;<br />

5 m = min (m, p ) ;<br />

6 R = t r i u ( qr (A) ) ;<br />

7 [U, S, V ] = svd (R( p−dim +1:m, p−dim +1:p ) ) ;<br />

8 n = V ( : , dim ) ;<br />

9 c = −R( 1 : p−dim , 1 : p−dim ) \R( 1 : p−dim , p−dim +1:p ) ∗n ;<br />

Given: overdetermined linear system of equations Ax = b, A ∈ R m,n , b ∈ R m , m ≥ n.<br />

Known: LSE solvable ⇔ b ∈ Im(A), if A, b were not perturbed,<br />

Sought:<br />

but A, b are perturbed (measurement errors).<br />

Solvable overdetermined system of equations Âx = ̂b, Â ∈ Rm,n , ̂b ∈ R m , “nearest”<br />

to Ax = b.<br />

✸<br />

Ôº¾¿ º¿<br />

This insight converts (6.2.9) to<br />

c · r 11 + n 1 · r 12 + · · · + r 1,d+1 · n d = 0 .<br />

⎛<br />

⎞⎛<br />

⎞<br />

r 22 r 23 · · · · · · r 2,d+1 n 1<br />

⎜ 0 r 33 · · · · · · r 3,d+1<br />

⎟⎜<br />

.<br />

⎟<br />

⎝<br />

. ... . ⎠⎝<br />

. ⎠<br />

→ min , ‖n‖ 2 = 1 . (6.2.10)<br />

∥ 0 r d+1,d+1 n d<br />

∥ 2<br />

Ôº¾¾ º¾<br />

(6.2.10) = problem of type (5.5.5), minimization on the Euclidean sphere.<br />

➣ Solve (6.2.10) using SVD !<br />

☞ least squares problem “turned upside down”: now we are allowed to tamper with system matrix<br />

and right hand side vector!<br />

Total least squares problem:<br />

Given: A ∈ R m,n , m ≥ n, rank(A) = n, b ∈ R m ,<br />

find:<br />

 ∈ R m,n , ̂b ∈ R m with<br />

]<br />

∥<br />

∥[A b] −<br />

[Â ̂b<br />

} {{ }<br />

∥ → min , ̂b ∈ Im( Â) .<br />

} {{ } F<br />

=:C<br />

=:Ĉ<br />

Ôº¾ º¿<br />

(6.3.1)

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

Saved successfully!

Ooh no, something went wrong!