I understand the basic principles involved in Kalman filtering and I have spend some time implementing several algorithms in Matlab. The problem I'm facing now is to check if the algorithm and my code actually do the right thing. I know that there are statistical tests, such as the NEES test (= normalized estimation error squared) and the NIS test (= normalized innovation squared). Their principle is described in the literature, but the description of implementation and interpretation of results is pretty vague. In the simulations I currently do, I can't get the NEES test to pass even for the perfectly matched model (while the NIS test normally passes)!

So my question is: Does anyone have tips, tricks, hints or references how to check the consistency of the filter and debug the code if needed (especially regarding the interpretation of test outcomes)?

I'm sorry that this question is a bit vague, I hope it still conforms with the board rules.

(Remark: I first posted this on signal processing but figured it might receive more attention here. If more detailed information is needed, I'm happy to make my post more specific!)

  1. Generate your own measurements, in a known scenario, that fulfills the assumptions
  2. Test it in the known scenario. If you do it in 1 or 2 dimensions, you can even do it by hand.
  3. Look at the properties. The autocorrelation of the innovation must be white if I am not mistaken (in a linear scenario, not 100% sure, but I know that in non-linear scenarios it is not. If some), so if you take the autocorrelation it should look approximately like a delta function.
  4. There are implementations online, it won't tell you that yours is right but it can make you think about the differences if there are.
  5. Check if what you get is what you are expecting to get. What is this? Well, in 2D, you are expecting to get an estimation which balances the prediction and the measurement, right? So If the result is not sort of in the middle, it is probably wrong.
  6. Be suspicious about everything you can.

And then if you have any particular point where you are not sure, post it.

There is a very nice description here, at least I liked it very much. https://cs.adelaide.edu.au/~ianr/Teaching/Estimation/LectureNotes2.pdf And since the link can break at any point, it is the file Estimation II from Ian Reid, Hillary Term 2001


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.