03.12.2012 Views

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

282 CHAPTER 14. NUMERICAL EXERCISES<br />

When measurements come in sequentially, i.e. at time steps t1, t2, . . ., we receive at time step<br />

tj the jth row of A and the jth element of b. In the algorithms we now discuss, we have the<br />

following<br />

14.7.1 The least squares QR algorithm<br />

A numerically stable method <strong>for</strong> solving (14.8) is based on the QR factorization. The QR<br />

factorization of the m × n matrix A is<br />

A = QR<br />

with Q ∈ R m×n and unitary (Q T Q = I) and R ∈ R n×n upper triangular. If A has full rank,<br />

the diagonal elements of R are non-zero. Suppose we have computed the solution <strong>for</strong><br />

where<br />

�Akx − bk�2 min<br />

�Akx − bk�2 = �QkRkx − bk�2<br />

= �Rkx − Q T k bk�2<br />

We have to solve an upper triangular linear system. We can develop a ‘sequential’ method <strong>for</strong><br />

this QR decomposition without storing Q, but we will not discuss this any further.<br />

14.7.2 The least squares method via the normal equations<br />

One method to achieve this are the normal equations. That is, multiply (14.7) on the left by<br />

A T , then we obtain<br />

A T Ax = A T b (14.9)<br />

If the A has full column rank, the solution of x is unique and satisfies (14.8).<br />

14.7.3 Least squares Kalman filtering<br />

The Kalman filter is a method to solve the normal equations (14.9) in a step by step way, i.e.<br />

the measurements come in time step at time step. The Kalman filter adapts the least squares<br />

solution to the newly arrived data.<br />

Suppose we have computed the least squares solution of<br />

Akxk = bk<br />

where Ak are the first k rows of A and bk the first k elements of b with k ≥ n. Then we want<br />

to compute the least squares solution of<br />

Since<br />

Ak+1 =<br />

� Ak<br />

a T k+1<br />

Ak+1xk+1 = bk+1 .<br />

�<br />

�<br />

and bk+1 =<br />

bk<br />

f(tk+1)<br />

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

Saved successfully!

Ooh no, something went wrong!