Data Science and Computing with Python for Pilots and Flight Test Engineers
Filtering, Prediction, and Smoothing
Given a dynamic system, we take measurements in regular (or irregular) time intervals, which we would like to use determine something about this system. For instance, we take radar/lidar measurements of a car driving by and are interested in its position over time. Or we take GPS measurements aboard the vehicle and also wonder about its position.
Because measurement values have an uncertainty (measurement error), we cannot simply take the last measurement, say of position, and say that the car is there, disregarding all prior measurements. If the measurement is very noisy, our estimate of the car’s position would jump around wildly (which would further greatly affect velocity estimates). Somehow we will want to combine the newest measurement with all previous measurements in generating our newest position estimate. This in itself it complicated, because the car was not in the same location at all measurements, so we cannot just average over all of them, as we would, when we measure an unchanging object several times.
Furthermore, while in principle we could use all past measurements to infer this information, with an increasing time series of measurements, this would become increasingly computationally challenging. We would therefore like to have a recursive algorithm, which does not require us to keep all past measurements individually. Instead, we will have a belief, where the car was previously (based of previous measurements), and use the newest measurement to update this belief in a statistically sound way.
One of the questions, which we need to specify is, what exactly we are interested in. The terminology for three of the options is as follows:
- Filtering: We have all measurements in the past and we would like to infer something about the system at the last point data was taken (i.e. now, if this algorithm is running in real time).
- Prediction: We have all measurements in the past and would like to infer something about the system in the future, e.g. a few seconds or minutes from now (or more generally, after the last data was taken). This algorithm can also be used in real time. Because there is a data gap between the last measurement and the future moment of prediction, this will require some sort of extrapolation (e.g. knowledge of the speed of the vehicle in the above car example).
- Smoothing: We have all measurements in the past and also in the future. Unless you have future sight, this algorithm can obviously not run in real time. But you can apply it to some collected data after the fact, to infer something about the system at any time during the period of the measurements. The result of such a smoother should be equal to or better than that of a filter, since the filter has only access to the data that was collected before the point in time of interest.
In the next several lessons we will learn how to perform vehicle state estimation and similar tasks with several different filters (including the well known Kalman filters, which come in different variation), and we will also look at the case of smoothing with the Rauch-Tung-Striebel smoother (which is essentially a Kalman filter not only running forward, but also backward in time).