Code Monkey home page Code Monkey logo

robust-kalman's Introduction

Robust Kalman

Alt Text

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 paper Robust 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 editing the code). Adaptive variance estimation is implemented only for measurement noise.

Usage

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 repo
from robust_kalman import RobustKalman

# Create the estimator by passing model parameters
kalman = RobustKalman(F, B, H, x0, P0, Q0, R0, use_robust_estimation=True)

# ...

# Do updates on every time step
kalman.time_update()
kalman.measurement_update(measurements)

# ...

# Get the estimations
print('Current state estimates', kalman.current_estimate)

Simple and fully functional example is available in the examples/example_simple.py. This example contains model definition, update loop and result plotting.

The example in the examples/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

robust-kalman's People

Contributors

milsto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

robust-kalman's Issues

Filtering for a weighing system

I'm building a weighing system. Here I filter analog data with kalman filter and moving average. I have a problem like this.

I put 2 kg on the scale and shake the weighing mechanism and create vibration. In this case, the 2 kg value moves +- 20 grams. If I increase my filtering coefficients, this play disappears, but this time the system reacts very slowly to changes of 1 gram. How can I solve this problem can you help me.

Feasibility of the author's approximate linear method

Is there a specific reason for not using the author's method for computing the new state variables? Like problems during matrix inversion etc.?

image

For example, sometimes the inverse of the matrix that is pointed out in the image is not computable due to singularity. Or am I doing something wrong? Could you help me with that, please? Thanks!

Also, I am implementing this based on the EKF model but I believe that should not be an issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.