GithubHelp home page GithubHelp logo

kalman.js's Introduction

Kalman.js - Kalman Filter in JavaScript

NPM Package Build Status MIT license

Usage

The constructor takes the initial state x and the initial covariance P. For each update cycle you have to provide all necessary vectors and matrices:

let filter = new Kalman(x0, P0)

loop {
  filter.update({
    A, // State design matrix
    B, // Input design matrix
    u, // Linear input variable 
    H, // Observation matrix
    R, // Sensor Noise Coviarance
    Q, // Process Noise Covariance (Optional)
    C, // Measurement design matrix
    y, // new measurement vector
  });
}

Note: Kalman.js is designed to work with the Sylvester Matrix library, but only uses it implicitly. You can use another library as long as it matches the method names of Sylvester.

Installation

Installing Kalman.js is as easy as cloning this repo or use one of the following commands:

bower install kalman

or

npm install kalman

Using Kalman.js with the browser

<script src="kalman.js"></script>
<script>
    var kf = new Kalman.KF;
    ...
</script>

Using Kalman.js with require.js

<script src="require.js"></script>
<script>
requirejs(['kalman.js'],
function(Kalman) {
    var kf = new Kalman.KF;
    ...
});
</script>

Coding Style

As every library I publish, Kalman.js is also built to be as small as possible after compressing it with Google Closure Compiler in advanced mode. Thus the coding style orientates a little on maxing-out the compression rate. Please make sure you keep this style if you plan to extend the library.

Testing

If you plan to enhance the library, make sure you add test cases and all the previous tests are passing. You can test the library with

npm test

Copyright and licensing

Copyright (c) 2016, Robert Eisele Dual licensed under the MIT or GPL Version 2 licenses.

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.