squiggle/__tests__/Bandwidth__Test.re
2020-04-03 13:25:42 +03:00

19 lines
528 B
ReasonML

open Jest;
open Expect;
[@bs.val] [@bs.module "science"] [@bs.scope ("stats", "bandwidth")]
external nrd0: array(float) => float = "nrd0";
[@bs.val] [@bs.module "science"] [@bs.scope ("stats", "bandwidth")]
external nrd: array(float) => float = "nrd";
describe("Bandwidth", () => {
test("nrd0 1", () => {
let data = [|1., 4., 3., 2.|];
expect(nrd0(data)) |> toEqual(0.7635139420854616);
});
test("nrd0 2", () => {
let data = [|1., 4., 3., 2.|];
expect(nrd(data)) |> toEqual(0.899249754011766);
});
});