Narcissistic Passion Minified

npm

Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

rlab

0.2.0 • Public • Published

rlab -- A JavaScript Scientific Library like R

introduction

The rlab is a A JavaScript Scientific Library like R.

It's based on `lodash.js , jStat.js and numeric.js`

There is a webIDE server based on rlab , you may start it by :

``````node rserver.js
``````

install

``````npm install rlab
``````

use rlab

file : rtest.js

run

``````D:\Dropbox\github\rlab>node rtest
dice= [ 1, 2, 3, 4, 5, 6 ]
x= [ 2, 1, 3, 4, 6, 5 ]
chain1:x= [ 6, 2, 3, 5, 1, 4 ]
chain2:x= [1, 2, 5, 6, 6, 3, 6, 6, 2, 5]
x= [ 5, 6, 3, 4, 6, 3, 4, 2, 5, 2 ] max= 6 min= 2 mean= 4 sd= 1.4907119849998598

cov(x,x)= 1.4907119849998598
cor(x,x)= 1
factorial(10)= 3628800
lfactorial(10)= 15.1044
choose(5,2)= 10
lchoose(5,2)= 2.302585092994045
permutation(5,2)= 20
runif(10, -5, -1)= [-3.3, -2.68, -3.5, -2.96, -4.48, -1.9, -2.12, -2.02, -4.59,
-4.09]
dunif(-3, -5, -1)= 0.25
punif(-3, -5, -1)= 0.5
qunif(0.5, -5, -1)= -3
x= [0.79, 0.49, 1.01, -1.13, 0.19, 0.4, -0.14, 1.01, 0.1, -1]
x.sort()= [-0.14, -1, -1.13, 0.1, 0.19, 0.4, 0.49, 0.79, 1.01, 1.01]
rbinom(10, 5, 0.5)= [ 3, 2, 3, 2, 3, 2, 3, 1, 2, 1 ]
dbinom(4, 5, 0.5)= 0.15625
dbinom(5, 5, 0.5)= 0.03125
pbinom(4, 5, 0.5)= 0.96875
qbinom(0.9, 5, 0.5)= 4
=========== report ==========
name    : "ttest(X)"
h       : "H0:mu=0"
alpha   : 0.05
op      : "="
pvalue  : 0.49
ci      : [-0.37, 0.71]
df      : 9
mean    : 0.17
sd      : 0.75
A= [[1, 2, 3], [4, 5, 6], [7, 3, 9]]
iA= [[-0.9, 0.3, 0.1], [-0.2, 0.4, -0.2], [0.77, -0.37, 0.1]]
AiA= [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
====iA=====
[[     -0.9,      0.3,      0.1],
[     -0.2,      0.4,     -0.2],
[     0.77,    -0.37,      0.1]]
``````

Keywords

Install

`npm i [email protected]`

0.2.0

MIT

Homepage

github.com/ccckmit/rlab

Repository

github.com/ccckmit/rlab