From a5c4cba2f098adf62fb0ddb53bf41fca418b8be8 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 27 Apr 2022 12:54:42 -0400 Subject: [PATCH] Updated tests Value: [1e-4 to 8e-3] --- packages/squiggle-lang/__tests__/TS/JS_test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/__tests__/TS/JS_test.ts b/packages/squiggle-lang/__tests__/TS/JS_test.ts index 6ce886a0..1974dee6 100644 --- a/packages/squiggle-lang/__tests__/TS/JS_test.ts +++ b/packages/squiggle-lang/__tests__/TS/JS_test.ts @@ -58,14 +58,15 @@ describe("Distribution", () => { ); test("mean", () => { - expect(dist.mean().value).toBeCloseTo(8.704375514292865); + expect(dist.mean().value).toBeCloseTo(9.5555555); }); test("pdf", () => { - expect(dist.pdf(5.0).value).toBeCloseTo(0.052007455285386944, 1); + expect(dist.pdf(5.0).value).toBeCloseTo(0.10499097598222966, 1); }); test("cdf", () => { expect(dist.cdf(5.0).value).toBeCloseTo( - dist1Samples.filter((x) => x <= 5).length / dist1SampleCount + dist1Samples.filter((x) => x <= 5).length / dist1SampleCount, + 1 ); }); test("inv", () => { @@ -91,6 +92,6 @@ describe("Distribution", () => { resultMap(dist.pointwiseAdd(dist2), (r: Distribution) => r.toSparkline(20) ).value - ).toEqual(Ok("▁▂▅██▅▅▅▆▆▇▅▄▃▃▂▂▁▁▁")); + ).toEqual(Ok("▁▂██▃▃▃▃▄▅▄▃▃▂▂▂▁▁▁▁")); }); });