I am looking at a tracking problem. It can be modelled similarly to the Extended Kalman Filter:

$$ \begin{array}{rcl} \mathbf{x}_k &=& \mathbf{f}(\mathbf{x}_{k-1}, \mathbf{u}_k) + \mathbf{w}_k\\ \mathbf{z}_k &=& \mathbf{h}(\mathbf{x}_k) + \mathbf{v}_k \end{array} $$

Here $\mathbf{x}$ is what I want to track, $\mathbf{u}$ are the controls, $\mathbf{z}$ are measurements and $\mathbf{w}$ and $\mathbf{v}$ are noise. The function h is the identity in my case. My problem is that the nonlinear function $\mathbf{f}(\mathbf{x},\mathbf{u})$ is not given in closed form (it's not something simple like $\sin(\mathbf{x}^T \mathbf{u}))$. I can only write a function in Java (or another programming language) which evaluates $\mathbf{f}(\mathbf{x},\mathbf{u})$ with an algorithm. Hence, I can't use the Extended Kalman Filter, because I can't build a derivative of $\mathbf{f}(\mathbf{x},\mathbf{u})$.

The only alternative that came to my mind is to use a particle filter, where it should not be a problem that $\mathbf{f}()$ is computed by an algorithm. However, it will probably be too computationally expensive, because $\mathbf{f}$ is computationally expensive and I would need to call it for each particle.

Does anybody have an idea for an alternative filter?

  • 1
    $\begingroup$ Look at the UKF $\endgroup$
    – user28715
    Mar 5 '18 at 20:44
  • 1
    $\begingroup$ Welcome to SE.DSP! I've changed your equations over to using MathJax -- the LaTeX-compatible math formatting system that we use. I hope I got it all right. Feel free to update if I didn't. $\endgroup$
    – Peter K.
    Mar 5 '18 at 21:07
  • $\begingroup$ @StanleyPawlukiewicz: Thanks, that looks promising! I will try it out using pykalman. $\endgroup$ Mar 6 '18 at 8:40
  • $\begingroup$ @PeterK. Thanks, I will use MathJax next time! $\endgroup$ Mar 6 '18 at 8:41

I will tell you something, even if it is differntiable, use Unscented Kalman Filter for any non linear case.

This flavor of Kalman Filter, based on the Unscented Transform, is almost always superior to the Extended Kalman due to its properties.
The main reason is it is able to better predict the mean and variance (Which all Kalman Filter needs) of the distribution after the non linear function applied.

In most cases it is even simpler to calculate hence more computationally efficient.
Think of it as Poor's man Particle Filter (Though the sampling points are deterministic).


In addition to the UKF, you could look at automatic differentiation. https://en.m.wikipedia.org/wiki/Automatic_differentiation

  • $\begingroup$ What's the point in Automatic Differentiation if the function isn't differentiable? $\endgroup$
    – David
    Feb 28 '20 at 9:14

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.