You should install node
and npm
.
For the jupyter kernel, I used this: https://www.npmjs.com/package/ijavascript
There's also this: https://github.com/notablemind/jupyter-nodejs
I bet there are others.
Following along from http://www.numericjs.com/workshop.php
I am using the minified JS file in this repo.
In [1]:
var n = require('./numeric-1.2.6.min.js');
Out[1]:
In [2]:
// Linear algebra example. We start with a matrix.
var A = [[1,2,3],
[4,5,6],
[7,3,9]];
A
Out[2]:
In [3]:
// Let's also make a vector.
var x = [3,1,2];
x
Out[3]:
In [4]:
// Matrix-vector product.
var b = n.dot(A, x);
b
Out[4]:
In [5]:
// Matrix inverse.
var Ainv = n.inv(A);
Ainv
Out[5]:
In [6]:
// Let's check it:
n.dot(Ainv,b);
Out[6]:
In [7]:
// Determinant
numeric.det(A);
Out[7]:
In [8]:
// Eigenvalues.
ev = numeric.eig(A)
Out[8]:
Need to try this too: https://github.com/hiddentao/linear-algebra
In [ ]: