From b2d80eef86062901db7915483b0219383fd089f3 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 9 May 2022 18:28:35 -0400 Subject: [PATCH 1/6] Removed negative infinity error handling Value: [1e-5 to 1e-3] --- .../Distributions/KlDivergence_test.res | 46 ++++++++++++++++++- .../PointSetDist/PointSetDist_Scoring.res | 3 +- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res index d9f98d8f..bb21ba7f 100644 --- a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res +++ b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res @@ -2,7 +2,7 @@ open Jest open Expect open TestHelpers -describe("kl divergence", () => { +describe("kl divergence on continuous distributions", () => { let klDivergence = DistributionOperation.Constructors.klDivergence(~env) exception KlFailed @@ -60,6 +60,48 @@ describe("kl divergence", () => { }) }) +describe("kl divergence on discrete distributions", () => { + let klDivergence = DistributionOperation.Constructors.klDivergence(~env) + let mixture = a => DistributionTypes.DistributionOperation.Mixture(a) + exception KlFailed + exception MixtureFailed + let float1 = 1.0 + let float2 = 2.0 + let float3 = 3.0 + let point1 = mkDirac(float1) + let point2 = mkDirac(float2) + let point3 = mkDirac(float3) + test("finite kl divergence", () => { + let answer = [(point1, 1e0), (point2, 1e0)]->mixture->run + let prediction = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run + let kl = switch (prediction, answer) { + | (Dist(prediction'), Dist(answer')) => klDivergence(prediction', answer') + | _ => raise(MixtureFailed) + } + let analyticalKl = Js.Math.log(2.0 /. 3.0) + switch kl { + | Ok(kl') => kl'->expect->toBeCloseTo(analyticalKl) + | Error(err) => + Js.Console.log(DistributionTypes.Error.toString(err)) + raise(KlFailed) + } + }) + test("infinite kl divergence", () => { + let prediction = [(point1, 1e0), (point2, 1e0)]->mixture->run + let answer = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run + let kl = switch (prediction, answer) { + | (Dist(prediction'), Dist(answer')) => klDivergence(prediction', answer') + | _ => raise(MixtureFailed) + } + switch kl { + | Ok(kl') => kl'->expect->toEqual(neg_infinity) + | Error(err) => + Js.Console.log(DistributionTypes.Error.toString(err)) + raise(KlFailed) + } + }) +}) + describe("combine along support test", () => { // This tests the version of the function that we're NOT using. Haven't deleted the test in case we use the code later. test("combine along support test", _ => { @@ -97,6 +139,7 @@ describe("combine along support test", () => { 2.0 *. MagicNumbers.Epsilon.ten, 1.0 -. MagicNumbers.Epsilon.ten, 1.0, + 1.0 +. MagicNumbers.Epsilon.ten, ], ys: [ -0.34657359027997264, @@ -104,6 +147,7 @@ describe("combine along support test", () => { -0.34657359027997264, -0.34657359027997264, -0.34657359027997264, + infinity, ], }), ), diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res index 70096d2a..e975dd5c 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res @@ -4,10 +4,9 @@ module KLDivergence = { float, Operation.Error.t, > => + // We decided that negative infinity, not an error at answerElement = 0.0, is a desirable value. if answerElement == 0.0 { Ok(0.0) - } else if predictionElement == 0.0 { - Error(Operation.NegativeInfinityError) } else { let quot = predictionElement /. answerElement quot < 0.0 ? Error(Operation.ComplexNumberError) : Ok(-.answerElement *. logFn(quot)) From ccd55ef8f1c7a1595e3756415f473ed945f4528b Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 9 May 2022 19:17:27 -0400 Subject: [PATCH 2/6] good evening, not working yet, but out of time for the night Value: [1e-6 to 1e-4] --- .../Distributions/KlDivergence_test.res | 8 +++--- .../squiggle-lang/__tests__/TestHelpers.res | 1 + .../Distributions/PointSetDist/Discrete.res | 26 ++++++++++++++----- .../PointSetDist/PointSetDist.res | 1 + 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res index bb21ba7f..2ba5100e 100644 --- a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res +++ b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res @@ -19,7 +19,7 @@ describe("kl divergence on continuous distributions", () => { let analyticalKl = Js.Math.log((highPrediction -. lowPrediction) /. (highAnswer -. lowAnswer)) let kl = E.R.liftJoin2(klDivergence, prediction, answer) switch kl { - | Ok(kl') => kl'->expect->toBeCloseTo(analyticalKl) + | Ok(kl') => kl'->expect->toBeSoCloseTo(analyticalKl, ~digits=7) | Error(err) => { Js.Console.log(DistributionTypes.Error.toString(err)) raise(KlFailed) @@ -51,7 +51,7 @@ describe("kl divergence on continuous distributions", () => { let kl = E.R.liftJoin2(klDivergence, prediction, answer) switch kl { - | Ok(kl') => kl'->expect->toBeCloseTo(analyticalKl) + | Ok(kl') => kl'->expect->toBeSoCloseTo(analyticalKl, ~digits=3) | Error(err) => { Js.Console.log(DistributionTypes.Error.toString(err)) raise(KlFailed) @@ -78,9 +78,9 @@ describe("kl divergence on discrete distributions", () => { | (Dist(prediction'), Dist(answer')) => klDivergence(prediction', answer') | _ => raise(MixtureFailed) } - let analyticalKl = Js.Math.log(2.0 /. 3.0) + let analyticalKl = Js.Math.log(3.0 /. 2.0) switch kl { - | Ok(kl') => kl'->expect->toBeCloseTo(analyticalKl) + | Ok(kl') => kl'->expect->toBeSoCloseTo(analyticalKl, ~digits=7) | Error(err) => Js.Console.log(DistributionTypes.Error.toString(err)) raise(KlFailed) diff --git a/packages/squiggle-lang/__tests__/TestHelpers.res b/packages/squiggle-lang/__tests__/TestHelpers.res index 54c4c814..21f3c51c 100644 --- a/packages/squiggle-lang/__tests__/TestHelpers.res +++ b/packages/squiggle-lang/__tests__/TestHelpers.res @@ -51,6 +51,7 @@ let mkExponential = rate => DistributionTypes.Symbolic(#Exponential({rate: rate} let mkUniform = (low, high) => DistributionTypes.Symbolic(#Uniform({low: low, high: high})) let mkCauchy = (local, scale) => DistributionTypes.Symbolic(#Cauchy({local: local, scale: scale})) let mkLognormal = (mu, sigma) => DistributionTypes.Symbolic(#Lognormal({mu: mu, sigma: sigma})) +let mkDirac = x => DistributionTypes.Symbolic(#Float(x)) let normalMake = SymbolicDist.Normal.make let betaMake = SymbolicDist.Beta.make diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index 31694232..658b7dc9 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -229,11 +229,25 @@ module T = Dist({ } let klDivergence = (prediction: t, answer: t) => { - combinePointwise( - ~combiner=XYShape.PointwiseCombination.combineAlongSupportOfSecondArgument0, - ~fn=PointSetDist_Scoring.KLDivergence.integrand, - prediction, - answer, - ) |> E.R2.bind(integralEndYResult) + let massOrZero = (t: t, x: float): float => { + let i = E.A.findIndex(x' => x' == x, t.xyShape.xs) + switch i { + | None => 0.0 + | Some(i') => t.xyShape.ys[i'] + } + } + let predictionNewYs = E.A.fmap(massOrZero(answer), prediction.xyShape.xs) + let integrand = XYShape.PointwiseCombination.combine( + PointSetDist_Scoring.KLDivergence.integrand, + XYShape.XtoY.continuousInterpolator(#Stepwise, #UseZero), + {XYShape.xs: answer.xyShape.xs, XYShape.ys: predictionNewYs}, + answer.xyShape, + ) + let xyShapeToDiscrete: XYShape.xyShape => t = xyShape => { + xyShape: xyShape, + integralSumCache: None, + integralCache: None, + } + integrand->E.R2.fmap(x => x->xyShapeToDiscrete->integralEndY) } }) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res index 0a8d2987..1879ebdd 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res @@ -199,6 +199,7 @@ module T = Dist({ let klDivergence = (t1: t, t2: t) => switch (t1, t2) { | (Continuous(t1), Continuous(t2)) => Continuous.T.klDivergence(t1, t2) + | (Discrete(t1), Discrete(t2)) => Discrete.T.klDivergence(t1, t2) | _ => Error(NotYetImplemented) } }) From 15f1ebb4290de8c4ebc0f22f28866e7e99ae153f Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 10 May 2022 11:27:59 -0400 Subject: [PATCH 3/6] KLDivergence on discretes is passing Value: [1e-3 to 2e-1] --- .../Distributions/KlDivergence_test.res | 12 ++++---- .../squiggle-lang/__tests__/TestHelpers.res | 2 +- .../Distributions/PointSetDist/Discrete.res | 28 ++++--------------- .../Distributions/PointSetDist/Mixed.res | 7 +++-- .../PointSetDist/PointSetDist_Scoring.res | 2 ++ 5 files changed, 19 insertions(+), 32 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res index 2ba5100e..3ed1788b 100644 --- a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res +++ b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res @@ -68,9 +68,9 @@ describe("kl divergence on discrete distributions", () => { let float1 = 1.0 let float2 = 2.0 let float3 = 3.0 - let point1 = mkDirac(float1) - let point2 = mkDirac(float2) - let point3 = mkDirac(float3) + let point1 = mkDelta(float1) + let point2 = mkDelta(float2) + let point3 = mkDelta(float3) test("finite kl divergence", () => { let answer = [(point1, 1e0), (point2, 1e0)]->mixture->run let prediction = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run @@ -94,7 +94,7 @@ describe("kl divergence on discrete distributions", () => { | _ => raise(MixtureFailed) } switch kl { - | Ok(kl') => kl'->expect->toEqual(neg_infinity) + | Ok(kl') => kl'->expect->toEqual(infinity) | Error(err) => Js.Console.log(DistributionTypes.Error.toString(err)) raise(KlFailed) @@ -102,9 +102,9 @@ describe("kl divergence on discrete distributions", () => { }) }) -describe("combine along support test", () => { +describe("combineAlongSupportOfSecondArgument", () => { // This tests the version of the function that we're NOT using. Haven't deleted the test in case we use the code later. - test("combine along support test", _ => { + test("test on two uniforms", _ => { let combineAlongSupportOfSecondArgument = XYShape.PointwiseCombination.combineAlongSupportOfSecondArgument0 let lowAnswer = 0.0 let highAnswer = 1.0 diff --git a/packages/squiggle-lang/__tests__/TestHelpers.res b/packages/squiggle-lang/__tests__/TestHelpers.res index 21f3c51c..71805c70 100644 --- a/packages/squiggle-lang/__tests__/TestHelpers.res +++ b/packages/squiggle-lang/__tests__/TestHelpers.res @@ -51,7 +51,7 @@ let mkExponential = rate => DistributionTypes.Symbolic(#Exponential({rate: rate} let mkUniform = (low, high) => DistributionTypes.Symbolic(#Uniform({low: low, high: high})) let mkCauchy = (local, scale) => DistributionTypes.Symbolic(#Cauchy({local: local, scale: scale})) let mkLognormal = (mu, sigma) => DistributionTypes.Symbolic(#Lognormal({mu: mu, sigma: sigma})) -let mkDirac = x => DistributionTypes.Symbolic(#Float(x)) +let mkDelta = x => DistributionTypes.Symbolic(#Float(x)) let normalMake = SymbolicDist.Normal.make let betaMake = SymbolicDist.Beta.make diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index 658b7dc9..04265d7c 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -50,7 +50,7 @@ let combinePointwise = ( make( combiner(fn, XYShape.XtoY.discreteInterpolator, t1.xyShape, t2.xyShape)->E.R.toExn( - "Addition operation should never fail", + "Logically unreachable?", _, ), )->Ok @@ -163,7 +163,6 @@ module T = Dist({ } let integralEndY = (t: t) => t.integralSumCache |> E.O.default(t |> integral |> Continuous.lastY) - let integralEndYResult = (t: t) => t->integralEndY->Ok let minX = shapeFn(XYShape.T.minX) let maxX = shapeFn(XYShape.T.maxX) let toDiscreteProbabilityMassFraction = _ => 1.0 @@ -229,25 +228,10 @@ module T = Dist({ } let klDivergence = (prediction: t, answer: t) => { - let massOrZero = (t: t, x: float): float => { - let i = E.A.findIndex(x' => x' == x, t.xyShape.xs) - switch i { - | None => 0.0 - | Some(i') => t.xyShape.ys[i'] - } - } - let predictionNewYs = E.A.fmap(massOrZero(answer), prediction.xyShape.xs) - let integrand = XYShape.PointwiseCombination.combine( - PointSetDist_Scoring.KLDivergence.integrand, - XYShape.XtoY.continuousInterpolator(#Stepwise, #UseZero), - {XYShape.xs: answer.xyShape.xs, XYShape.ys: predictionNewYs}, - answer.xyShape, - ) - let xyShapeToDiscrete: XYShape.xyShape => t = xyShape => { - xyShape: xyShape, - integralSumCache: None, - integralCache: None, - } - integrand->E.R2.fmap(x => x->xyShapeToDiscrete->integralEndY) + combinePointwise( + ~fn=PointSetDist_Scoring.KLDivergence.integrand, + prediction, + answer, + )->E.R2.fmap(integralEndY) } }) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Mixed.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Mixed.res index 50cd8939..05465728 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Mixed.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Mixed.res @@ -302,9 +302,10 @@ module T = Dist({ } let klDivergence = (prediction: t, answer: t) => { - combinePointwise(PointSetDist_Scoring.KLDivergence.integrand, prediction, answer) |> E.R.fmap( - integralEndY, - ) + Error(Operation.NotYetImplemented) + // combinePointwise(PointSetDist_Scoring.KLDivergence.integrand, prediction, answer) |> E.R.fmap( + // integralEndY, + // ) } }) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res index e975dd5c..b22883df 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist_Scoring.res @@ -7,6 +7,8 @@ module KLDivergence = { // We decided that negative infinity, not an error at answerElement = 0.0, is a desirable value. if answerElement == 0.0 { Ok(0.0) + } else if predictionElement == 0.0 { + Ok(infinity) } else { let quot = predictionElement /. answerElement quot < 0.0 ? Error(Operation.ComplexNumberError) : Ok(-.answerElement *. logFn(quot)) From f7690c33e0226754a91a83ff71539c8a5079bbb7 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 10 May 2022 11:56:13 -0400 Subject: [PATCH 4/6] Some cleanup Value: [1e-4 to 1e-2] --- .../Distributions/KlDivergence_test.res | 35 ++++++++++--------- .../Distributions/PointSetDist/Discrete.res | 7 +--- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res index 3ed1788b..8eb9974c 100644 --- a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res +++ b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res @@ -2,7 +2,7 @@ open Jest open Expect open TestHelpers -describe("kl divergence on continuous distributions", () => { +describe("klDivergence: continuous -> continuous -> float", () => { let klDivergence = DistributionOperation.Constructors.klDivergence(~env) exception KlFailed @@ -60,7 +60,7 @@ describe("kl divergence on continuous distributions", () => { }) }) -describe("kl divergence on discrete distributions", () => { +describe("klDivergence: discrete -> discrete -> float", () => { let klDivergence = DistributionOperation.Constructors.klDivergence(~env) let mixture = a => DistributionTypes.DistributionOperation.Mixture(a) exception KlFailed @@ -71,13 +71,17 @@ describe("kl divergence on discrete distributions", () => { let point1 = mkDelta(float1) let point2 = mkDelta(float2) let point3 = mkDelta(float3) - test("finite kl divergence", () => { - let answer = [(point1, 1e0), (point2, 1e0)]->mixture->run - let prediction = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run - let kl = switch (prediction, answer) { - | (Dist(prediction'), Dist(answer')) => klDivergence(prediction', answer') - | _ => raise(MixtureFailed) - } + let a' = [(point1, 1e0), (point2, 1e0)]->mixture->run + let b' = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run + let (a, b) = switch (a', b') { + | (Dist(a''), Dist(b'')) => (a'', b'') + | _ => raise(MixtureFailed) + } + test("is finite", () => { + let prediction = b + let answer = a + let kl = klDivergence(prediction, answer) + // Sigma_{i \in 1..2} 0.5 * log(0.5 / 0.33333) let analyticalKl = Js.Math.log(3.0 /. 2.0) switch kl { | Ok(kl') => kl'->expect->toBeSoCloseTo(analyticalKl, ~digits=7) @@ -86,13 +90,10 @@ describe("kl divergence on discrete distributions", () => { raise(KlFailed) } }) - test("infinite kl divergence", () => { - let prediction = [(point1, 1e0), (point2, 1e0)]->mixture->run - let answer = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run - let kl = switch (prediction, answer) { - | (Dist(prediction'), Dist(answer')) => klDivergence(prediction', answer') - | _ => raise(MixtureFailed) - } + test("is infinite", () => { + let prediction = a + let answer = b + let kl = klDivergence(prediction, answer) switch kl { | Ok(kl') => kl'->expect->toEqual(infinity) | Error(err) => @@ -102,7 +103,7 @@ describe("kl divergence on discrete distributions", () => { }) }) -describe("combineAlongSupportOfSecondArgument", () => { +describe("combineAlongSupportOfSecondArgument0", () => { // This tests the version of the function that we're NOT using. Haven't deleted the test in case we use the code later. test("test on two uniforms", _ => { let combineAlongSupportOfSecondArgument = XYShape.PointwiseCombination.combineAlongSupportOfSecondArgument0 diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index 04265d7c..abb6b793 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -48,12 +48,7 @@ let combinePointwise = ( // TODO: does it ever make sense to pointwise combine the integrals here? // It could be done for pointwise additions, but is that ever needed? - make( - combiner(fn, XYShape.XtoY.discreteInterpolator, t1.xyShape, t2.xyShape)->E.R.toExn( - "Logically unreachable?", - _, - ), - )->Ok + combiner(fn, XYShape.XtoY.discreteInterpolator, t1.xyShape, t2.xyShape)->E.R2.fmap(make) } let reduce = ( From 29c1956e884354c9f76845160cfa72831b362b36 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 10 May 2022 14:03:42 -0400 Subject: [PATCH 5/6] Response to CR Value: [1e-6 to 1e-4] --- .../Distributions/GenericDist_Fixtures.res | 10 ++++++++++ .../__tests__/Distributions/KlDivergence_test.res | 13 +++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Distributions/GenericDist_Fixtures.res b/packages/squiggle-lang/__tests__/Distributions/GenericDist_Fixtures.res index 4d41930f..8e315599 100644 --- a/packages/squiggle-lang/__tests__/Distributions/GenericDist_Fixtures.res +++ b/packages/squiggle-lang/__tests__/Distributions/GenericDist_Fixtures.res @@ -12,3 +12,13 @@ let triangularDist: DistributionTypes.genericDist = Symbolic( let exponentialDist: DistributionTypes.genericDist = Symbolic(#Exponential({rate: 2.0})) let uniformDist: DistributionTypes.genericDist = Symbolic(#Uniform({low: 9.0, high: 10.0})) let floatDist: DistributionTypes.genericDist = Symbolic(#Float(1e1)) + +exception KlFailed +exception MixtureFailed +let float1 = 1.0 +let float2 = 2.0 +let float3 = 3.0 +let {mkDelta} = module(TestHelpers) +let point1 = mkDelta(float1) +let point2 = mkDelta(float2) +let point3 = mkDelta(float3) diff --git a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res index 8eb9974c..96e95899 100644 --- a/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res +++ b/packages/squiggle-lang/__tests__/Distributions/KlDivergence_test.res @@ -1,6 +1,7 @@ open Jest open Expect open TestHelpers +open GenericDist_Fixtures describe("klDivergence: continuous -> continuous -> float", () => { let klDivergence = DistributionOperation.Constructors.klDivergence(~env) @@ -63,21 +64,13 @@ describe("klDivergence: continuous -> continuous -> float", () => { describe("klDivergence: discrete -> discrete -> float", () => { let klDivergence = DistributionOperation.Constructors.klDivergence(~env) let mixture = a => DistributionTypes.DistributionOperation.Mixture(a) - exception KlFailed - exception MixtureFailed - let float1 = 1.0 - let float2 = 2.0 - let float3 = 3.0 - let point1 = mkDelta(float1) - let point2 = mkDelta(float2) - let point3 = mkDelta(float3) let a' = [(point1, 1e0), (point2, 1e0)]->mixture->run let b' = [(point1, 1e0), (point2, 1e0), (point3, 1e0)]->mixture->run let (a, b) = switch (a', b') { | (Dist(a''), Dist(b'')) => (a'', b'') | _ => raise(MixtureFailed) } - test("is finite", () => { + test("agrees with analytical answer when finite", () => { let prediction = b let answer = a let kl = klDivergence(prediction, answer) @@ -90,7 +83,7 @@ describe("klDivergence: discrete -> discrete -> float", () => { raise(KlFailed) } }) - test("is infinite", () => { + test("returns infinity when infinite", () => { let prediction = a let answer = b let kl = klDivergence(prediction, answer) From 4ecb420a8ba6fdd38b92eb4a6919bbdcae293fb1 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 10 May 2022 15:50:44 -0400 Subject: [PATCH 6/6] Re-added `^`-versioning to mathjs Value: [1e-9 to 1e-5] --- packages/squiggle-lang/package.json | 2 +- yarn.lock | 242 ++++++++++++++-------------- 2 files changed, 122 insertions(+), 122 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 49dad58c..9ca9dc2e 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -38,7 +38,7 @@ "rescript": "^9.1.4", "jstat": "^1.9.5", "pdfast": "^0.2.0", - "mathjs": "10.5.0" + "mathjs": "^10.5.2" }, "devDependencies": { "bisect_ppx": "^2.7.1", diff --git a/yarn.lock b/yarn.lock index a8181cd8..876f1d82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1935,19 +1935,19 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== -"@eslint/eslintrc@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.2.tgz#4989b9e8c0216747ee7cca314ae73791bb281aae" - integrity sha512-lTVWHs7O2hjBFZunXTZYnYqtB9GakA1lnxIf+gKq2nY5gxkkNi/lQvveW6t8gFdOHTg6nG50Xs95PrLqVpcaLg== +"@eslint/eslintrc@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.3.tgz#fcaa2bcef39e13d6e9e7f6271f4cc7cae1174886" + integrity sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.1" + espree "^9.3.2" globals "^13.9.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" - minimatch "^3.0.4" + minimatch "^3.1.2" strip-json-comments "^3.1.1" "@gar/promisify@^1.0.1": @@ -2278,9 +2278,9 @@ integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== "@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.10" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz#db436f0917d655393851bc258918c00226c9b183" - integrity sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q== + version "0.3.11" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.11.tgz#eb2e124521f27673493030d02dffedf60e56553f" + integrity sha512-RllI476aSMsxzeI9TtlSMoNTgHDxEmnl6GkkHwhr0vdL8W+0WuesyI8Vd3rBOfrwtPXbPxdT9ADJdiOKgzxPQA== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" @@ -2291,9 +2291,9 @@ integrity sha512-zMM9Ds+SawiUkakS7y94Ymqx+S0ORzpG3frZirN3l+UlXUmSUR7hF4wxCVqW+ei94JzV5kt0uXBcoOEAuiydrw== "@leichtgewicht/ip-codec@^2.0.1": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz#0300943770e04231041a51bd39f0439b5c7ab4f0" - integrity sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg== + version "2.0.4" + resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" + integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== "@mdx-js/loader@^1.6.22": version "1.6.22" @@ -2390,9 +2390,9 @@ rimraf "^3.0.2" "@pmmmwh/react-refresh-webpack-plugin@^0.5.1", "@pmmmwh/react-refresh-webpack-plugin@^0.5.3": - version "0.5.5" - resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.5.tgz#e77aac783bd079f548daa0a7f080ab5b5a9741ca" - integrity sha512-RbG7h6TuP6nFFYKJwbcToA1rjC1FyPg25NR2noAZ0vKI+la01KTSRPkuVPE+U88jXv7javx2JHglUcL1MHcshQ== + version "0.5.6" + resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.6.tgz#9ced74cb23dae31ab385f775e237ce4c50422a1d" + integrity sha512-IIWxofIYt/AbMwoeBgj+O2aAXLrlCQVg+A4a2zfpXFNHgP8o8rvi3v+oe5t787Lj+KXlKOh8BAiUp9bhuELXhg== dependencies: ansi-html-community "^0.0.8" common-path-prefix "^3.0.0" @@ -4371,13 +4371,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.22.0.tgz#7b52a0de2e664044f28b36419210aea4ab619e2a" - integrity sha512-YCiy5PUzpAeOPGQ7VSGDEY2NeYUV1B0swde2e0HzokRsHBYjSdF6DZ51OuRZxVPHx0032lXGLvOMls91D8FXlg== + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.23.0.tgz#bc4cbcf91fbbcc2e47e534774781b82ae25cc3d8" + integrity sha512-hEcSmG4XodSLiAp1uxv/OQSGsDY6QN3TcRU32gANp+19wGE1QQZLRS8/GV58VRUoXhnkuJ3ZxNQ3T6Z6zM59DA== dependencies: - "@typescript-eslint/scope-manager" "5.22.0" - "@typescript-eslint/type-utils" "5.22.0" - "@typescript-eslint/utils" "5.22.0" + "@typescript-eslint/scope-manager" "5.23.0" + "@typescript-eslint/type-utils" "5.23.0" + "@typescript-eslint/utils" "5.23.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -4386,75 +4386,75 @@ tsutils "^3.21.0" "@typescript-eslint/experimental-utils@^5.0.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.22.0.tgz#a2b40eaa52ae1d1e316bc861069c40883a7ccf6e" - integrity sha512-rKxoCUtAHwEH6IcAoVpqipY6Th+YKW7WFspAKu0IFdbdKZpveFBeqxxE9Xn+GWikhq1o03V3VXbxIe+GdhggiQ== + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.23.0.tgz#ea03860fa612dadf272789988f2ce41f0b7bb2f7" + integrity sha512-I+3YGQztH1DM9kgWzjslpZzJCBMRz0KhYG2WP62IwpooeZ1L6Qt0mNK8zs+uP+R2HOsr+TeDW35Pitc3PfVv8Q== dependencies: - "@typescript-eslint/utils" "5.22.0" + "@typescript-eslint/utils" "5.23.0" "@typescript-eslint/parser@^5.5.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.22.0.tgz#7bedf8784ef0d5d60567c5ba4ce162460e70c178" - integrity sha512-piwC4krUpRDqPaPbFaycN70KCP87+PC5WZmrWs+DlVOxxmF+zI6b6hETv7Quy4s9wbkV16ikMeZgXsvzwI3icQ== + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.23.0.tgz#443778e1afc9a8ff180f91b5e260ac3bec5e2de1" + integrity sha512-V06cYUkqcGqpFjb8ttVgzNF53tgbB/KoQT/iB++DOIExKmzI9vBJKjZKt/6FuV9c+zrDsvJKbJ2DOCYwX91cbw== dependencies: - "@typescript-eslint/scope-manager" "5.22.0" - "@typescript-eslint/types" "5.22.0" - "@typescript-eslint/typescript-estree" "5.22.0" + "@typescript-eslint/scope-manager" "5.23.0" + "@typescript-eslint/types" "5.23.0" + "@typescript-eslint/typescript-estree" "5.23.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.22.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.22.0.tgz#590865f244ebe6e46dc3e9cab7976fc2afa8af24" - integrity sha512-yA9G5NJgV5esANJCO0oF15MkBO20mIskbZ8ijfmlKIvQKg0ynVKfHZ15/nhAJN5m8Jn3X5qkwriQCiUntC9AbA== +"@typescript-eslint/scope-manager@5.23.0": + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.23.0.tgz#4305e61c2c8e3cfa3787d30f54e79430cc17ce1b" + integrity sha512-EhjaFELQHCRb5wTwlGsNMvzK9b8Oco4aYNleeDlNuL6qXWDF47ch4EhVNPh8Rdhf9tmqbN4sWDk/8g+Z/J8JVw== dependencies: - "@typescript-eslint/types" "5.22.0" - "@typescript-eslint/visitor-keys" "5.22.0" + "@typescript-eslint/types" "5.23.0" + "@typescript-eslint/visitor-keys" "5.23.0" -"@typescript-eslint/type-utils@5.22.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.22.0.tgz#0c0e93b34210e334fbe1bcb7250c470f4a537c19" - integrity sha512-iqfLZIsZhK2OEJ4cQ01xOq3NaCuG5FQRKyHicA3xhZxMgaxQazLUHbH/B2k9y5i7l3+o+B5ND9Mf1AWETeMISA== +"@typescript-eslint/type-utils@5.23.0": + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.23.0.tgz#f852252f2fc27620d5bb279d8fed2a13d2e3685e" + integrity sha512-iuI05JsJl/SUnOTXA9f4oI+/4qS/Zcgk+s2ir+lRmXI+80D8GaGwoUqs4p+X+4AxDolPpEpVUdlEH4ADxFy4gw== dependencies: - "@typescript-eslint/utils" "5.22.0" + "@typescript-eslint/utils" "5.23.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.22.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.22.0.tgz#50a4266e457a5d4c4b87ac31903b28b06b2c3ed0" - integrity sha512-T7owcXW4l0v7NTijmjGWwWf/1JqdlWiBzPqzAWhobxft0SiEvMJB56QXmeCQjrPuM8zEfGUKyPQr/L8+cFUBLw== +"@typescript-eslint/types@5.23.0": + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.23.0.tgz#8733de0f58ae0ed318dbdd8f09868cdbf9f9ad09" + integrity sha512-NfBsV/h4dir/8mJwdZz7JFibaKC3E/QdeMEDJhiAE3/eMkoniZ7MjbEMCGXw6MZnZDMN3G9S0mH/6WUIj91dmw== -"@typescript-eslint/typescript-estree@5.22.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.22.0.tgz#e2116fd644c3e2fda7f4395158cddd38c0c6df97" - integrity sha512-EyBEQxvNjg80yinGE2xdhpDYm41so/1kOItl0qrjIiJ1kX/L/L8WWGmJg8ni6eG3DwqmOzDqOhe6763bF92nOw== +"@typescript-eslint/typescript-estree@5.23.0": + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.23.0.tgz#dca5f10a0a85226db0796e8ad86addc9aee52065" + integrity sha512-xE9e0lrHhI647SlGMl+m+3E3CKPF1wzvvOEWnuE3CCjjT7UiRnDGJxmAcVKJIlFgK6DY9RB98eLr1OPigPEOGg== dependencies: - "@typescript-eslint/types" "5.22.0" - "@typescript-eslint/visitor-keys" "5.22.0" + "@typescript-eslint/types" "5.23.0" + "@typescript-eslint/visitor-keys" "5.23.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.22.0", "@typescript-eslint/utils@^5.13.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.22.0.tgz#1f2c4897e2cf7e44443c848a13c60407861babd8" - integrity sha512-HodsGb037iobrWSUMS7QH6Hl1kppikjA1ELiJlNSTYf/UdMEwzgj0WIp+lBNb6WZ3zTwb0tEz51j0Wee3iJ3wQ== +"@typescript-eslint/utils@5.23.0", "@typescript-eslint/utils@^5.13.0": + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.23.0.tgz#4691c3d1b414da2c53d8943310df36ab1c50648a" + integrity sha512-dbgaKN21drqpkbbedGMNPCtRPZo1IOUr5EI9Jrrh99r5UW5Q0dz46RKXeSBoPV+56R6dFKpbrdhgUNSJsDDRZA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.22.0" - "@typescript-eslint/types" "5.22.0" - "@typescript-eslint/typescript-estree" "5.22.0" + "@typescript-eslint/scope-manager" "5.23.0" + "@typescript-eslint/types" "5.23.0" + "@typescript-eslint/typescript-estree" "5.23.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.22.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.22.0.tgz#f49c0ce406944ffa331a1cfabeed451ea4d0909c" - integrity sha512-DbgTqn2Dv5RFWluG88tn0pP6Ex0ROF+dpDO1TNNZdRtLjUr6bdznjA6f/qNqJLjd2PgguAES2Zgxh/JzwzETDg== +"@typescript-eslint/visitor-keys@5.23.0": + version "5.23.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.23.0.tgz#057c60a7ca64667a39f991473059377a8067c87b" + integrity sha512-Vd4mFNchU62sJB8pX19ZSPog05B0Y0CE2UxAZPT5k4iqhRYjPnqyY3woMxCd0++t9OTqkgjST+1ydLBi7e2Fvg== dependencies: - "@typescript-eslint/types" "5.22.0" + "@typescript-eslint/types" "5.23.0" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -4786,7 +4786,7 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== -acorn-jsx@^5.3.1: +acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -4820,7 +4820,7 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.0: +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: version "8.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== @@ -5023,9 +5023,9 @@ ansi-to-html@^0.6.11: entities "^2.0.0" antd@^4.20.0: - version "4.20.2" - resolved "https://registry.yarnpkg.com/antd/-/antd-4.20.2.tgz#1ed2042a091eecfebd9650c014a1a2e57430ff2b" - integrity sha512-b+Gq1EY8LmcS/ARei/dGI0bWQlJ/j3f3oJ6XjM+ryyT5YWxvf7X3mGc++bTGuLmjn6+/icRL1zItIgcvplcomg== + version "4.20.3" + resolved "https://registry.yarnpkg.com/antd/-/antd-4.20.3.tgz#21f77332d201ea9f1d76685ca9534b4796791c81" + integrity sha512-liZB/OguxPPNnssiR8UH5gjAV3LetsnA8K0G+VBVJkCZsU5QmCDL05d059Nu6iRD7FVg0drSONZQwvWD4pO4nw== dependencies: "@ant-design/colors" "^6.0.0" "@ant-design/icons" "^4.7.0" @@ -6189,9 +6189,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335: - version "1.0.30001338" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001338.tgz#b5dd7a7941a51a16480bdf6ff82bded1628eec0d" - integrity sha512-1gLHWyfVoRDsHieO+CaeYe7jSo/MT7D7lhaXUiwwbuR5BwQxORs0f1tAwUSQr3YbxRXJvxHM/PA5FfPQRnsPeQ== + version "1.0.30001339" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001339.tgz#f9aece4ea8156071613b27791547ba0b33f176cf" + integrity sha512-Es8PiVqCe+uXdms0Gu5xP5PF2bxLR7OBp3wUzUnuO7OHzhOfCyg3hdiGWVPVxhiuniOzng+hTc1u3fEQ0TlkSQ== capture-exit@^2.0.0: version "2.0.0" @@ -6818,17 +6818,17 @@ copy-webpack-plugin@^10.2.4: serialize-javascript "^6.0.0" core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.8.1: - version "3.22.4" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.22.4.tgz#d700f451e50f1d7672dcad0ac85d910e6691e579" - integrity sha512-dIWcsszDezkFZrfm1cnB4f/J85gyhiCpxbgBdohWCDtSVuAaChTSpPV7ldOQf/Xds2U5xCIJZOK82G4ZPAIswA== + version "3.22.5" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.22.5.tgz#7fffa1d20cb18405bd22756ca1353c6f1a0e8614" + integrity sha512-rEF75n3QtInrYICvJjrAgV03HwKiYvtKHdPtaba1KucG+cNZ4NJnH9isqt979e67KZlhpbCOTwnsvnIr+CVeOg== dependencies: browserslist "^4.20.3" semver "7.0.0" core-js-pure@^3.20.2, core-js-pure@^3.8.1, core-js-pure@^3.8.2: - version "3.22.4" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.22.4.tgz#a992210f4cad8b32786b8654563776c56b0e0d0a" - integrity sha512-4iF+QZkpzIz0prAFuepmxwJ2h5t4agvE8WPYqs2mjLJMNNwJOnpch76w2Q7bUfCPEv/V7wpvOfog0w273M+ZSw== + version "3.22.5" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.22.5.tgz#bdee0ed2f9b78f2862cda4338a07b13a49b6c9a9" + integrity sha512-8xo9R00iYD7TcV7OrC98GwxiUEAabVWO3dix+uyWjnYrx9fyASLlIX+f/3p5dW5qByaP2bcZ8X/T47s55et/tA== core-js@^2.4.0: version "2.6.12" @@ -6836,9 +6836,9 @@ core-js@^2.4.0: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.0.4, core-js@^3.19.2, core-js@^3.22.3, core-js@^3.6.5, core-js@^3.8.2: - version "3.22.4" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.4.tgz#f4b3f108d45736935aa028444a69397e40d8c531" - integrity sha512-1uLykR+iOfYja+6Jn/57743gc9n73EWiOnSJJ4ba3B4fOEYDBv25MagmEZBxTp5cWq4b/KPx/l77zgsp28ju4w== + version "3.22.5" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.5.tgz#a5f5a58e663d5c0ebb4e680cd7be37536fb2a9cf" + integrity sha512-VP/xYuvJ0MJWRAobcmQ8F2H6Bsn+s7zqAAjFaHGBMc5AQm7zaelhD1LGduFn2EehEcQcU+br6t+fwbpQ5d1ZWA== core-util-is@~1.0.0: version "1.0.3" @@ -7924,9 +7924,9 @@ ejs@^3.1.6: jake "^10.8.5" electron-to-chromium@^1.4.118: - version "1.4.136" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.136.tgz#b6a3595a9c29d6d8f60e092d40ac24f997e4e7ef" - integrity sha512-GnITX8rHnUrIVnTxU9UlsTnSemHUA2iF+6QrRqxFbp/mf0vfuSc/goEyyQhUX3TUUCE3mv/4BNuXOtaJ4ur0eA== + version "1.4.137" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz#186180a45617283f1c012284458510cd99d6787f" + integrity sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA== element-resize-detector@^1.2.2: version "1.2.4" @@ -8311,9 +8311,9 @@ eslint-plugin-react@^7.27.1: string.prototype.matchall "^4.0.6" eslint-plugin-testing-library@^5.0.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.3.1.tgz#7638ee79cc86fd8bb57d671af35a1cbaa77e9548" - integrity sha512-OfF4dlG/q6ck6DL3P8Z0FPdK0dU5K57gsBu7eUcaVbwYKaNzjgejnXiM9CCUevppORkvfek+9D3Uj/9ZZ8Vz8g== + version "5.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.4.0.tgz#614767a470bc9ffa4b4308cdbc31d3ec6f6a99ad" + integrity sha512-XjxIf4g33KaZXxRNbR33+0WcRQ/zt8N0R58IY6/kkHnrY6zPsC1gs3u5cTZr5eUmCZN/sjoPak3uF5vHGKg2wg== dependencies: "@typescript-eslint/utils" "^5.13.0" @@ -8370,11 +8370,11 @@ eslint-webpack-plugin@^3.1.1: schema-utils "^3.1.1" eslint@^8.3.0: - version "8.14.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.14.0.tgz#62741f159d9eb4a79695b28ec4989fcdec623239" - integrity sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw== + version "8.15.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.15.0.tgz#fea1d55a7062da48d82600d2e0974c55612a11e9" + integrity sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA== dependencies: - "@eslint/eslintrc" "^1.2.2" + "@eslint/eslintrc" "^1.2.3" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -8385,7 +8385,7 @@ eslint@^8.3.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.1" + espree "^9.3.2" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -8401,7 +8401,7 @@ eslint@^8.3.0: json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" regexpp "^3.2.0" @@ -8410,13 +8410,13 @@ eslint@^8.3.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.3.1: - version "9.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd" - integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ== +espree@^9.3.2: + version "9.3.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" + integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== dependencies: - acorn "^8.7.0" - acorn-jsx "^5.3.1" + acorn "^8.7.1" + acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" esprima@^4.0.0, esprima@^4.0.1: @@ -9303,9 +9303,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.13.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.13.0.tgz#ac32261060d8070e2719dd6998406e27d2b5727b" - integrity sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A== + version "13.14.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.14.0.tgz#daf3ff9b4336527cf56e98330b6f64bea9aff9df" + integrity sha512-ERO68sOYwm5UuLvSJTY7w7NP2c8S4UcXs3X1GBX8cwOr+ShOcDBbCY5mH4zxz0jsYCdJ8ve8Mv9n2YGJMB1aeg== dependencies: type-fest "^0.20.2" @@ -9315,9 +9315,9 @@ globals@^9.18.0: integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== globalthis@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" - integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== dependencies: define-properties "^1.1.3" @@ -10119,9 +10119,9 @@ invariant@^2.2.2, invariant@^2.2.4: loose-envify "^1.0.0" ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= + version "1.1.7" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.7.tgz#4f6195d7bdb30435aac35301e7b993c6c8218c0d" + integrity sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg== ipaddr.js@1.9.1: version "1.9.1" @@ -11806,10 +11806,10 @@ markdown-to-jsx@^7.1.3: resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.7.tgz#a5f22102fb12241c8cea1ca6a4050bb76b23a25d" integrity sha512-VI3TyyHlGkO8uFle0IOibzpO1c1iJDcXcS/zBrQrXQQvJ2tpdwVzVZ7XdKsyRz1NdRmre4dqQkMZzUHaKIG/1w== -mathjs@10.5.0: - version "10.5.0" - resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-10.5.0.tgz#f81d0518fe7b4b2a0b85e1125b8ecfc364fb0292" - integrity sha512-gRnSY9psN9zgiB2QV9F4XbuX5hwjxY5Ou7qoTFWDbn2vZ3UEs+sjfK/SRg2WP30TNfZWpwlGdp8H1knFJnpFdA== +mathjs@^10.5.2: + version "10.5.2" + resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-10.5.2.tgz#bf0618b99b662a3af8a2613b6489ec0422314b08" + integrity sha512-yLl2yA597A+07+xsOgy1+pq/m4ZokQceWQbB9OsIkK2guCpA2Px9k11zul93eJAA0WUFZiMK6VcruY9ZBbSKjA== dependencies: "@babel/runtime" "^7.17.9" complex.js "^2.1.1" @@ -14285,9 +14285,9 @@ rc-pagination@~3.1.9: classnames "^2.2.1" rc-picker@~2.6.4: - version "2.6.8" - resolved "https://registry.yarnpkg.com/rc-picker/-/rc-picker-2.6.8.tgz#eff71e13d836953a4c7439c958228b5108f92c22" - integrity sha512-j14N2nxcx4PAw7LviwLKIJG4cEAlCFhcHI/7pz+Ps43Df7UrSIWt/QGJgPAWz38Z6jrjsgMcyVHVccpL09gDDA== + version "2.6.9" + resolved "https://registry.yarnpkg.com/rc-picker/-/rc-picker-2.6.9.tgz#2f2f82c5340adbe3b30875a25e015c120eb88c9c" + integrity sha512-yH3UYXCADf7REtOAB5cwe1cyFKtB0p204RCN8JdZGG4uuSOZ1IPTkk/GJS6HOpxspZeJCLGzzajuQMDwck9dsw== dependencies: "@babel/runtime" "^7.10.1" classnames "^2.2.1" @@ -14463,9 +14463,9 @@ rc-upload@~4.3.0: rc-util "^5.2.0" rc-util@^5.0.1, rc-util@^5.0.6, rc-util@^5.12.0, rc-util@^5.14.0, rc-util@^5.15.0, rc-util@^5.16.1, rc-util@^5.17.0, rc-util@^5.18.1, rc-util@^5.19.2, rc-util@^5.2.0, rc-util@^5.2.1, rc-util@^5.20.0, rc-util@^5.20.1, rc-util@^5.21.0, rc-util@^5.3.0, rc-util@^5.4.0, rc-util@^5.5.0, rc-util@^5.6.1, rc-util@^5.7.0, rc-util@^5.8.0, rc-util@^5.9.4, rc-util@^5.9.8: - version "5.21.2" - resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-5.21.2.tgz#fa23277ba84e5561af2febdca64de3fc2b3e1528" - integrity sha512-QuuZ2tKMScGtxSx3rLzgPGGDZm/np7phMqA7OcDidSf44abvSk+AdtdD7ZvQPvCEtdC6nCSI5tEVnUaYjjD9/w== + version "5.21.4" + resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-5.21.4.tgz#61e24ad297f679ca0796b618a3ef30eca959d904" + integrity sha512-rq11ap3NnOIdywFhcMQ9J7DXRJJ1c1Id1Hvr/1Dphr+5X75ERJBJybuh779DdurP4LJQqAhT6Aie0AjrBc5Vqw== dependencies: "@babel/runtime" "^7.12.5" react-is "^16.12.0" @@ -15412,9 +15412,9 @@ rollup-plugin-terser@^7.0.0: terser "^5.0.0" rollup@^2.43.1: - version "2.72.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.72.0.tgz#f94280b003bcf9f2f1f2594059a9db5abced371e" - integrity sha512-KqtR2YcO35/KKijg4nx4STO3569aqCUeGRkKWnJ6r+AvBBrVY9L4pmf4NHVrQr4mTOq6msbohflxr2kpihhaOA== + version "2.72.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.72.1.tgz#861c94790537b10008f0ca0fbc60e631aabdd045" + integrity sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA== optionalDependencies: fsevents "~2.3.2"