1
$\begingroup$

When using a Kalman filter, one of the variables that must be defined is a matrix representing the covariance of the observation noise. In the implementations I have seen, this matrix is defined once, and that same matrix is then used throughout the algorithm, each time an update step is taken.

However, in my particular problem, I am able to get a state-dependent covariance of the observation noise. This is because instead of using the raw observation, I actually use the observation to predict the state (using some machine learning), and this prediction itself comes with a known uncertainty. This is effectively equivalent to treating the state prediction as my "observation", and the uncertainty from this prediction as the covariance of the observation noise.

So, in the update step of the Kalman filter, could I use this state-dependent noise covariance, such that each update would use a different covariance matrix? Or does this invalidate all the maths, and I really do need to use a fixed covariance matrix for the entire algorithm?

$\endgroup$
2
$\begingroup$

The math is generally only done out for a fixed covariance matrix, so yes you would be invalidating the math. If you had an analytic solution, or at least bounds, for how your covariance changes it might be possible to redo the math to either prove the normal equations still have the same guarantees or give updated equations.

That said, in practice the covariance matrix is often treated as a tuning variable rather than real observation covariance. Even worse, nonlinear Kalman filters also invalidate the math. Both situations are very common, though, and have proved to work well when experimentally tuned. Generally all you are loosing is optimality and perhaps a narrower operation window.

| improve this answer | |
$\endgroup$
  • $\begingroup$ This would not be invalidating the math. The kalman filter update equation consumes a state estimate, a state uncertainty, a measurement,and a measurement uncertainty. These terms are used to calculate the new stare estimate and state uncertainty. It has no explicit reliance on the previous measurements or measurement uncertainties. $\endgroup$ – holmeski Jan 5 at 1:12
  • $\begingroup$ The update equations are fine as is but all the properties associated with them are invalidated; things like optimality and general convergence. The proofs that Kalman Filters have those properties assume a static covariance matrix. $\endgroup$ – ryan0270 Jan 5 at 15:00
  • $\begingroup$ The update equations will optimally incorporate the new information with it's inherent uncertainty. $\endgroup$ – holmeski Jan 5 at 16:19
  • $\begingroup$ The update equations generate a new, unbiased estimate with a new covariance. Any properties you are referring to are the result of the assumption of a static measurement noise, this assumption is made to develop intuition about the kalman filter in a classroom, it is not necessary for the kalman filter to be optimal in the unbiased, least squares way. $\endgroup$ – holmeski Jan 5 at 16:27
1
$\begingroup$

The maths of the Kalman filter depend on a dynamic Ricatti equation. Under some assumtions about the covariance matrices, this dynamic equiation is stable and converges to a solution. The Kalman filter implementation that you must likely know, obtains the filter gain (also known as Kalman gain) by using the solution of the Ricatti equation for the (user) given convariance matrices.Ths produces a simpified steady state filter implementation which is the most widely used version of the Kalman filter.

As @ryan0279 mentioned, the simplified steady state solution has certain mathematical properties that make the filter have some very nice stability and performace characteristics. If you implement the filter differently, these characteristics might no longer hold. You might end up with an unstable filter.

Nevertheless, this does not mean that you cannot implement the filter using a time-varying model or covariance matrices. Heck, the widely used version of the nonlinear version of the Kalman Filter (Extended Kalman Filter kind of does that. Of course stability is not guaranteed for these kind of implementations, but people use them any way because in many use cases they just work.

A way to implement what you want is to solve the dynamic ricatti equation of the Kamlan filter along with your filter dynamics, similar to how the Hybrid Kalman Filter is implemented. Then on each iteration of the ricatti equation solution, update your convariance matrices however you like. Just beware that you are entering the nonlinear domain and you might endup getting weird results and unstable estimates. But maybe after some tuning and testing all your operating conditions you are able to make it work fine.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Is a normal Kalman filter not appropriate here? This seems like a textbook case for filtering. $\endgroup$ – holmeski Jan 5 at 1:22
  • $\begingroup$ Which specific Kalman filter version you mean with "normal"? Most people understand "normal" KF as the linear, steady state solution with fixed Kalman gain, in which case no, the steady state KF is not appropriate for time varying covariance matrices. $\endgroup$ – Juan Gonzalez Burgos Jan 8 at 13:50
  • $\begingroup$ I meant a textbook, linear kalman filter. $\endgroup$ – holmeski Jan 8 at 13:58
  • $\begingroup$ I that case no, because as I understand the question refers to state-dependent (time varying) covariance matrices (en.wikipedia.org/wiki/…). And the "normal" Kalman filter assumes static matrices to compute the solution to the Ricatti eq in order to obtain the fixed Kalman gain. $\endgroup$ – Juan Gonzalez Burgos Jan 8 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.