From 4054f7dbfffc91e059da6c4fd509d9721969daef Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 5 Jul 2022 19:48:41 -0400 Subject: [PATCH] Small beta error message change --- .../rescript/Distributions/SymbolicDist/SymbolicDist.res | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res index e7471ffa..249deb02 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res @@ -134,8 +134,10 @@ module Beta = { let fromMeanAndStdev = (mean, stdev) => { // https://en.wikipedia.org/wiki/Beta_distribution#Mean_and_variance - if !(0.0 < stdev && stdev <= 0.5) || !(0.0 <= mean && mean <= 1.0) { - "Beta mean must be in [0,1] and stdev must be in (1,0.5]"->Error + if !(0.0 < stdev && stdev <= 0.5) { + Error("Stdev must be in in between 0 and 0.5.") + } else if !(0.0 <= mean && mean <= 1.0) { + Error("Mean must be in between 0 and 1.0.") } else { let var = stdev *. stdev let sampleSize = mean *. (1.0 -. mean) /. var -. 1.0