infusion / kalman.js Goto Github PK
View Code? Open in Web Editor NEWA JavaScript Kalman filter library
A JavaScript Kalman filter library
I have been been trying to use Kalman.js in a simple node application, but I struggling to resolve the error 'TypeError: Cannot read property 'multiply' of undefined'. I am using Sylvester. I have looked at issue #1 which used math and part of the resolution was a recommendation to use Sylvester.
I rewrote the math code using Sylvester and it gives the same error about A.multipy.
My adapted code is from issue 1 is:
const Kalman = require('kalman');
const sylvester = require('sylvester');
let valx = [ 4, 5 ];
let valp = $M([[ 5, 0 ], [ 0, 4 ]]);
var valr = [];
var vala = $M([[ 5, 0 ], [ 0, 4 ]]);
valr['A'] = vala;
let kf = new Kalman.KF(valx, valp);
kf.update(valr);
Running this gives: TypeError: Cannot read property 'multiply' of undefined
at KF.update (C:\Users\david\source\repos\sharesApr2020\NodeJS\nodeApp\node_modules\kalman\kalman.js:75:36).
I am probably missing something simple. Do you have any suggestions?
var kalman = require('kalman');
var math = require('mathjs');
let valx = [ 4, 5 ];
let valp = math.matrix([[ 5, 0 ], [ 0, 4 ]]);
var valr = [];
var vala = math.matrix([[ 5, 0 ], [ 0, 4 ]]);
valr['A'] = vala;
let kf = new kalman.KF(valx, valp);
kf.update(valr);
After start found the error:
Wondering what's wrong, thanks.
kalman.js:75
var xhat = A.multiply(x).add(B.multiply(u));
^
TypeError: A.multiply is not a function
at KF.update (...kalman.js:75:18)
at Object. (...index2.js:21:4)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.