From c6727c40a55a815acc1b24c5cd4daeaef3c5683a Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 16 Feb 2020 12:27:44 +0000 Subject: [PATCH] FloatCdf -> GuesstimatorDist --- src/_obsolete/Test2.re | 10 +++++++--- src/lib/{FloatCdf.re => GuesstimatorDist.re} | 0 src/models/EAFunds.re | 2 +- src/models/GlobalCatastrophe.re | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) rename src/lib/{FloatCdf.re => GuesstimatorDist.re} (100%) diff --git a/src/_obsolete/Test2.re b/src/_obsolete/Test2.re index 6a2ee56e..9303a7e8 100644 --- a/src/_obsolete/Test2.re +++ b/src/_obsolete/Test2.re @@ -27,7 +27,7 @@ type otherSettings = {currentYear: int}; let sharesOutstanding = (price, marketCap) => switch (price, marketCap) { | (Some(price), Some(marketCap)) => - Some(FloatCdf.divide(marketCap, price)) + Some(GuesstimatorDist.divide(marketCap, price)) | _ => None }; @@ -42,11 +42,15 @@ let rec run = | (SHARE_PRICE, year, Some(price), _) when year > 2019 && year < 2030 => let diffYears = year - otherSettings.currentYear; let diffPerYear = 0.1; - Some(FloatCdf.normal(price, float_of_int(diffYears) *. diffPerYear)); + Some( + GuesstimatorDist.normal(price, float_of_int(diffYears) *. diffPerYear), + ); | (MARKET_CAP, year, _, Some(price)) when year > 2019 && year < 2030 => let diffYears = year - otherSettings.currentYear; let diffPerYear = 0.1; - Some(FloatCdf.normal(price, float_of_int(diffYears) *. diffPerYear)); + Some( + GuesstimatorDist.normal(price, float_of_int(diffYears) *. diffPerYear), + ); | (SHARES_OUTSTANDING, year, _, _) when year > 2019 && year < 2030 => let price = run(company, year, SHARE_PRICE, otherSettings); let marketCap = run(company, year, MARKET_CAP, otherSettings); diff --git a/src/lib/FloatCdf.re b/src/lib/GuesstimatorDist.re similarity index 100% rename from src/lib/FloatCdf.re rename to src/lib/GuesstimatorDist.re diff --git a/src/models/EAFunds.re b/src/models/EAFunds.re index 2caf295c..5edb0497 100644 --- a/src/models/EAFunds.re +++ b/src/models/EAFunds.re @@ -78,7 +78,7 @@ module Model = { let yearDiff = MomentRe.diff(dateTime, currentDateTime, `days) /. 365.; let meanDiff = Js.Math.pow_float(~base=y.meanDiff, ~exp=yearDiff); let stdDevDiff = Js.Math.pow_float(~base=y.meanDiff, ~exp=yearDiff); - FloatCdf.logNormal( + GuesstimatorDist.logNormal( currentValue *. meanDiff, firstYearStdDev *. stdDevDiff, ); diff --git a/src/models/GlobalCatastrophe.re b/src/models/GlobalCatastrophe.re index d405758a..8644cfb8 100644 --- a/src/models/GlobalCatastrophe.re +++ b/src/models/GlobalCatastrophe.re @@ -1,9 +1,9 @@ -// ~generationSource=GuesstimatorString(, module Model = { let make = (currentDateTime: MomentRe.Moment.t) => { let genericDistribution = GenericDistribution.make( - ~generationSource=GuesstimatorString(FloatCdf.logNormal(20., 3.)), + ~generationSource= + GuesstimatorString(GuesstimatorDist.logNormal(20., 3.)), ~probabilityType=Cdf, ~domain=RightLimited({xPoint: 200., excludingProbabilityMass: 0.3}), ~unit=Time({zero: currentDateTime, unit: `years}),