-
-
Notifications
You must be signed in to change notification settings - Fork 30
Stats
Arthur Guiot edited this page May 18, 2018
·
1 revision
Get the average of a list of numbers like that:
t.average(10, 20, 15) // 15 => BigNumberIf you have an array, use the
...operator
t.average(...[10, 20, 15]) // 15 => BigNumber
Get the median of a list of numbers like that:
t.median(53, 64, 22, 32) // 42.5 => BigNumberIf you have an array, use the
...operator
t.median(...[53, 64, 22, 32]) // 42.5 => BigNumber
Uses the same algorithm as Excel
Get the correlation of two Arrays like that:
t.correlation([3, 2, 4, 5, 6], [9, 7, 12, 15, 17]) // ≈ 0.997054486 => BigNumberTheoremJS supports regression up to infinity degree (in theory), but you can be certain that regressions up to the 50th degree should be fine.
You need to input a set point that follows TheoremJS notation, and the highest degree you want.
t.regression({
0: 2,
1: 5,
3: 11
}, 1) // f(x) = 3x + 2 => Polynomial
t.regression({
0: 1,
1: 3,
2: 9
}, 2) // f(x) = 2x^2 + 1 => PolynomialThis is how it looks:
Any questions? Don't hesitate to create an issue and tell me about your problem 😊.
Copyright © 2017-2018 Arthur Guiot
