deno.land / x / simplestatistic@v7.7.1 / test / quantile_rank.test.js

quantile_rank.test.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* eslint no-shadow: 0 */
const test = require("tap").test;const ss = require("../");
test("quantileRank", function (t) { // Data and results from // [Scipy](https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py) t.test("can get proper quantile ranks", function (t) { t.equal(ss.quantileRank([3, 2, 4, 1], 3), 0.75); t.equal(ss.quantileRank([4, 3, 2, 1, 3], 3), 0.7); t.equal(ss.quantileRank([2, 1, 3, 4], 6), 1); t.equal(ss.quantileRank([4, 1, 2, 3], -3), 0); t.equal(ss.quantileRank([5, 2, 1, 3, 3], 4), 0.8); t.equal(ss.quantileRank([5, 567, 1, 11, 2, 22, 4, 45, 3, 34], 5), 0.5); t.end(); }); t.end();});
simplestatistic

Version Info

Tagged at
2 years ago