Since the discrete Kalman filter is recursive, the looping can be continued inde- finitely, in principle, at least. There are practical limits, though, and under certain conditions divergence problems can arise. We elaborate briefly on three common sources of difficulty.
Roundoff Errors
As with any numerical procedure, roundoff error can lead to problems as the number of steps becomes large. There is no one simple solution to this, and each case has to be examined on its own merits. Fortunately, if the system is observable and process noise drives each of the state variables, the Kalman filter has a degree of natural
stability. In this case a stable, steady-state solution for theP matrix will normally
exist, even if the process is nonstationary. If the P matrix is perturbed from its
steady-state solution in such a way as not to lose positive definiteness, then it tends
to return to the same steady-state solution. This is obviously helpful, providedP
does not lose its symmetry and positive definiteness. (See Section 5.8 for more on filter stability.)
Some techniques that have been found useful in preventing, or at least forestalling, roundoff error problems are:
1. Use high-precision arithmetic, especially in off-line analysis work. 2. If possible, avoid deterministic (undriven) processes in the filter modeling.
(Example: a random constant.) These usually lead to a situation where theP
matrix approaches a semidefinite condition as the number of steps becomes
large. A small error may then trip theP matrix into a non-positive definite
condition, and this can then lead to divergence. A good solution is to add (if
necessary) small positive quantities to the major diagonal terms of the Q
matrix. This amounts to inserting a small amount of process noise to each of the states. This leads to a degree of suboptimality, but that is better than having the filter diverge!
3. Symmetrize the error covariance matrix with each step. This is easily done by forming the average of the matrix and its transpose. This is probably the 5.4 DIVERGENCE PROBLEMS 181
most important way of avoiding divergence due to computational frailties. It
might appear at first glance that triple product operations such asfPfT or
I KH
ð ÞPðI KHÞT will always produce symmetric results. Be wary of
this. Symmetry is only assured if the inner matrice in the product is, in its
self, symmetric. Thus, it is important to keep bothP and P symmetric on
long runs.
4. Large uncertainty in the initial estimate can sometimes lead to numerical
problems. For example, in a navigation situation, if we start the filter’sP0
matrix with very large values along the major diagonal, and if we then
follow this with a very precise measurement at t¼ 0, the P matrix must
transition from a very large value to a value close to zero in one step. It can
be seen from the P-update equation
Pk¼ I Kð kHkÞPk (5.4.1)
that this situation approximates the indeterminate form 0 1. One should
always be cautious in this kind of numerical situation. One possible solution
is to make the elements ofP0 artificially smaller and simply recognize that
the filter will be suboptimal for the first few steps. Another possibility is to use one of the forms of square-root filtering. This mitigates the problem of extremely large swings in the error covariance from step to step. (See Section 5.7 for more on square root filtering.)
Gross Modeling Errors
Another type of divergence may arise because of inaccurate modeling of the process being estimated. This has nothing to do with numerical roundoff; it occurs simply because the designer (engineer) “told” the Kalman filter that the process behaved one way, whereas, in fact, it behaves another way. As a simple example, if you tell the filter that the process is a random constant (i.e., zero slope), and the actual process is a random ramp (nonzero slope), the filter will be continually trying to fit the wrong curve to the measurement data! This can also occur with nondeterministic as well as deterministic processes, as will now be demonstrated.
EXAMPLE 5.2
Consider a process that is actually random walk but is incorrectly modeled as a random constant. We have then (with numerical values inserted to correspond to a subsequent simulation):
(a) The “truth model”:
x_ ¼ u tð Þ; u tð Þ ¼ unity Gaussian white noise; and Var x 0½ ð Þ ¼ 1
zk¼ xkþ vk; measurement samples at t ¼ 0; 1; 2; . . .
and Var vð Þ ¼ :1k
(b) Incorrect Kalman filter model:
x ¼ constant; where x N 0; 1ð Þ
The moral to Example 5.2 is simply this. Any model that assumes the process, or any facet of the process, to be absolutely constant forever and ever is a risky model. In the physical world, very few things remain absolutely constant. Instru- ment biases, even though called “biases,” have a way of slowly changing with time.
The Kalman filter parameters for the incorrect model (b) are: fk ¼ 1;
Qk¼ 0; Hk¼ 1; Rk¼ :1; ^x0¼ 0; and P0 ¼ 1. For the truth model the parameters
are the same except that Qk¼ 1, rather than zero.
The random walk process (a) was simulated using Gaussian random numbers with zero mean and unity variance. The resulting sample process for 35 sec is
shown in Fig. 5.4. A measurement sequence zk of this sample process was also
generated using another set ofN 0; 1ð Þ random numbers for uk. This measurement
sequence was first processed using the incorrect model (i.e., Qk¼ 0), and again
with the correct model (i.e., Qk¼ 1). The results are shown along with the sample
process in Fig. 5.4. In this case, the measurement noise is relatively smallðs :3Þ,
and we note that the estimates of the correctly modeled filter follow the random walk quite well. On the other hand, the incorrectly modeled filter does very poorly after the first few steps. This is due to the filter’s gain becoming less and less with each succeeding step. At the 35th step the gain is almost two orders of magnitude less than at the beginning. Thus, the filter becomes very sluggish and will not follow the random walk. Had the simulation been allowed to go on further, it would have become even more sluggish.
&
Figure 5.4 Simulation results for random walk example.
Thus, most instruments need occasional recalibration. The obvious remedy for this type of divergence problem is always to insert some process noise into each of the state variables. Do this even at the risk of some degree of suboptimality; it makes for a much safer filter than otherwise. It also helps with potential roundoff problems. (Note: Don’t “blame” the filter for this kind of divergence problem. It is the fault of the designer/analyst, not the filter!). This example will be continued as Example 5.5 in Section 5.5.
Observability Problem
There is a third kind of divergence problem that may occur when the system is not observable. Physically, this means that there are one or more state variables (or linear combinations thereof) that are hidden from the view of the observer (i.e., the measurements). As a result, if the unobserved processes are unstable, the corre- sponding estimation errors will be similarly unstable. This problem has nothing to do with roundoff error or inaccurate system modeling. It is just a simple fact of life that sometimes the measurement situation does not provide enough information to estimate all the state variables of the system. In a sense, this type of problem should not even be referred to as divergence, because the filter is still doing the best estimation possible under adverse circumstances.
There are formal tests of observability that may be applied to systems of low dimensionality, These tests are not always practical to apply, though, in higher- order systems. Sometimes one is not even aware that a problem exists until after extensive error analysis of the system. If unstable estimation errors exist, this will be
evidenced by one or more terms along the major diagonal ofP tending to increase
without bound. If this is observed, and proper precautions against roundoff error have been taken, the analyst knows an observability problem exists. The only really good solution to this kind of divergence is to improve the observability situation by adding appropriate measurements to make the system completely observable.