- Notifications
You must be signed in to change notification settings - Fork49
Robust Kalman filter with adaptive noise statistics estimation.
License
milsto/robust-kalman
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Python implementation of a robust Kalman estimator using so called M-robust estimation with support for adaptive noise variance estimation. Robust estimation is used to give better estimates when the data is polluted by outliers (see figure above).
Implementation is based on the method presented in the paperRobust Estimation with Unknown Noise Statistics. Main difference is that iterative Nelder-Mead algorithm is used for nonlinear minimization problems instead of approximate linear method proposed by original authors (one may try out other methods if interested by editingthe code). Adaptive variance estimation is implemented only for measurement noise.
Robust Kalman may be easily integrated in the user's code using few intuitive API calls as shown in the sample below.
# Import RobustKalman provided by the package in this repofromrobust_kalmanimportRobustKalman# Create the estimator by passing model parameterskalman=RobustKalman(F,B,H,x0,P0,Q0,R0,use_robust_estimation=True)# ...# Do updates on every time stepkalman.time_update()kalman.measurement_update(measurements)# ...# Get the estimationsprint('Current state estimates',kalman.current_estimate)
Simple and fully functional example is available in theexamples/example_simple.py. This example contains model definition, update loop and result plotting.
The example in theexamples/example_advanced.py was intended for the authors coursework in the Stochastic System Theory at Masters program in Signal processing at University of Belgrade, School of Electrical Engineering. That script was used to generate results presented in the image above.
Author: Miloš Stojanović Stojke