Search code examples
pythonkalman-filter

Why my easurements and estimates are same for kalman filter?


I am implementing a Kalman filter in Python but unfortunately, my estimated and measured results are the same. I was expecting smother result for the estimates. Below is my result for one state. enter image description here

Please suggest to me any solution to this issue.


Solution

  • The Kalman filter is not just magically smoothing your output given your model. Actually a Kalman is filter doing something pretty straightforward, it just compares measurement to model noise (usually called process noise). Only if the process noise is small compared to the measurement noise the Kalman filter will smooth your measurements.

    So, given that you have an estimate for your measurement noise, it all boils down to how accurate you THINK your model is. Try to think about the assumptions you do in your model. For example: Do you assume a value to be constant, that in reality could show dynamics? Then try to estimate the magnitude of this dynamics and use it for your process noise. Unfortunately there is no clear recipee for tuning a Kalman filter. It's a lot of black magic mixed with some experience.