5.1 Example: A Simple Spacecraft

Suppose we are traveling in our spacecraft towards the moon and we have just finished firing our engine to send us on our way. As we are “sailing” through space, we want to know how far away we are from Earth and we periodically take sightings of the stars in order to estimate our position.

Our “state” \(x_t\) is the radial distance of our spacecraft from Earth. Barring any acceleration, if the spacecraft’s position at time \(t-1\) is \(p_{t-1}\) and its velocity is \(v_{t-1}\), then Newton’s laws tell us that its position at time \(t\) is

\[ p_t = p_{t-1} + v_{t-1}\Delta t + w_t. \] where \(\Delta t\) is the time elapsed between time points \(w_t\) represents some noise or minor perturbation (e.g. \(w_t\sim\mathcal{N}(0,\tau^2)\). In some cases, we may assume \(w_t=0\). Thus, the state equation here embodies the idea that “a body in motion stays in motion”.

We can write this equation, slightly differently, using vectors and matrices as

\[ \left[ \begin{array}{c} p_t\\ v_t \end{array} \right] = \left[\begin{array}{cc} 1 & \Delta t \\ 0 & 1 \\ \end{array} \right] \left[ \begin{array}{c} p_{t-1}\\ v_{t-1}\\ \end{array} \right] + \left[\begin{array}{c} w_{1t}\\ w_{2t} \end{array} \right] \]

If there is in fact no acceleration, we know that the velocity will not be changing from time \(t-1\) to time \(t\) (except perhaps for some minor perturbation). If we let

\[\begin{eqnarray*} x_t & = & \left[ \begin{array}{c} p_t\\ v_t \end{array} \right]\\ \Theta & = & \left[\begin{array}{cc} 1 & \Delta t\\ 0 & 1 \end{array} \right]\\ w_t & = & \left[\begin{array}{c} w_{1t}\\ w_{2t} \end{array} \right] \end{eqnarray*}\]

then our state equation is simply

\[ x_t = \Theta x_{t-1} + w_t. \]

At this point we have not discussed data, but without any observations of the system, we would have to assume that the system evolves according to the state equation. Therefore, if we knew the initial state \(x_0\), our best guess for the subsequent states would be

\[ x_1 = \Theta x_0, x_2 = \Theta x_1, \dots \]

and so on. These are not so much “estimates” (because there are no data), but rather predictions of what the next state should be based on our knowledge of the underlying dynamics of the system.

The question then is what should we do if we observe data \(y_t\) at time \(t\)? And what exactly do we expect to observe at time \(t\)? A secondary question might be how often do we need to take measurements in order to have a good estimate of our state?

Now suppose we occasionally observe our position via measurements taken on board the spacecraft and at time \(t\) we observe our position \(y_t\), which is

\[ y_t = p_t + v_t, \]

so \(y_t\) is a noisy measurement of our true position (i.e. \(v_t\sim\mathcal{N}(0,\sigma^2)\). We can similarly write this in full form using our state vector as

\[ y_t = \left[\begin{array}{cc} 1 & 0 \end{array} \right] x_t + v_t \] If we let

\[ A= \left[\begin{array}{cc} 1 & 0 \end{array} \right] \]

then we have \(y_t = Ax_t + v_t\), our observation equation. How does our knowledge of \(x_t\) change once we observe \(y_t\)? The answer is given by the Kalman filter.