2020-02-28 10:32:12 +00:00
|
|
|
// Examples:
|
|
|
|
// mm(floor(uniform(30,35)), normal(50,20), [.25,.5])
|
|
|
|
// mm(floor(normal(28,4)), normal(32,2), uniform(20,24), [.5,.2,.1])
|
|
|
|
// mm(5 to 20, floor(normal(20,2)), [.5, .5])"
|
|
|
|
// floor(3 to 4)
|
|
|
|
// uniform(0,1) > 0.3 ? lognormal(6.652, -0.41): 0
|
2020-02-24 21:01:29 +00:00
|
|
|
|
2020-02-17 22:53:39 +00:00
|
|
|
let timeDist =
|
2020-02-23 12:49:33 +00:00
|
|
|
DistPlusIngredients.make(
|
2020-02-25 12:28:26 +00:00
|
|
|
~guesstimatorString="(floor(10 to 15))",
|
2020-02-25 19:27:30 +00:00
|
|
|
~domain=RightLimited({xPoint: 50.0, excludingProbabilityMass: 0.3}),
|
2020-02-24 21:33:27 +00:00
|
|
|
~unit=
|
|
|
|
DistTypes.TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
|
2020-02-17 22:53:39 +00:00
|
|
|
(),
|
2020-02-24 21:33:27 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
let setup = dist =>
|
|
|
|
dist
|
2020-02-25 12:28:26 +00:00
|
|
|
|> DistPlusIngredients.toDistPlus(
|
2020-03-04 11:08:50 +00:00
|
|
|
~sampleCount=2000,
|
|
|
|
~outputXYPoints=1000,
|
2020-02-25 12:28:26 +00:00
|
|
|
~truncateTo=Some(1000),
|
2020-03-04 10:27:50 +00:00
|
|
|
)
|
|
|
|
|> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />);
|
2020-02-17 22:53:39 +00:00
|
|
|
|
2020-03-04 11:08:50 +00:00
|
|
|
let simpleExample = (name, guesstimatorString) =>
|
|
|
|
<>
|
|
|
|
<h3 className="text-gray-600 text-lg font-bold">
|
|
|
|
{name |> ReasonReact.string}
|
|
|
|
</h3>
|
|
|
|
{setup(DistPlusIngredients.make(~guesstimatorString, ()))}
|
|
|
|
</>;
|
|
|
|
|
|
|
|
let timeExample = (name, guesstimatorString) =>
|
|
|
|
<>
|
|
|
|
<h3 className="text-gray-600 text-lg font-bold">
|
|
|
|
{name |> ReasonReact.string}
|
|
|
|
</h3>
|
|
|
|
{setup(
|
|
|
|
DistPlusIngredients.make(
|
|
|
|
~guesstimatorString,
|
|
|
|
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
|
|
|
|
(),
|
|
|
|
),
|
|
|
|
)}
|
|
|
|
</>;
|
|
|
|
|
2020-02-17 22:53:39 +00:00
|
|
|
let distributions = () =>
|
2020-02-17 21:52:21 +00:00
|
|
|
<div>
|
|
|
|
<div>
|
2020-03-04 10:27:50 +00:00
|
|
|
<h2 className="text-gray-800 text-xl font-bold">
|
|
|
|
{"Initial Section" |> ReasonReact.string}
|
|
|
|
</h2>
|
2020-03-04 11:08:50 +00:00
|
|
|
{simpleExample("Continuous", "5 to 20")}
|
|
|
|
{simpleExample("Continuous, wide range", "1 to 1000000")}
|
|
|
|
{simpleExample("Continuous, tiny values", "0.000000001 to 0.00000001")}
|
|
|
|
{simpleExample(
|
|
|
|
"Continuous large values",
|
|
|
|
"50000000000 to 2000000000000",
|
|
|
|
)}
|
|
|
|
{simpleExample("Discrete", "floor(10 to 20)")}
|
|
|
|
{simpleExample("Discrete, wide range", "floor(10 to 200000)")}
|
|
|
|
{simpleExample("Mixed", "mm(5 to 20, floor(20 to 30), [.5,.5])")}
|
|
|
|
{simpleExample("Mixed, Early-Discrete Point", "mm(1, 5 to 20, [.5,.5])")}
|
|
|
|
{simpleExample(
|
|
|
|
"Mixed, Single-Discrete Point",
|
|
|
|
"mm(5, 5 to 20, [.5,.5])",
|
2020-03-04 10:27:50 +00:00
|
|
|
)}
|
2020-03-04 11:08:50 +00:00
|
|
|
{simpleExample(
|
|
|
|
"Mixed, Two-Discrete Points",
|
|
|
|
"mm(0,10, 5 to 20, [.5,.5,.5])",
|
2020-03-04 10:27:50 +00:00
|
|
|
)}
|
|
|
|
<h2 className="text-gray-800 text-xl font-bold">
|
|
|
|
{"Over Time" |> ReasonReact.string}
|
|
|
|
</h2>
|
2020-03-04 11:08:50 +00:00
|
|
|
{timeExample("Continuous", "5 to 20")}
|
|
|
|
{timeExample("Continuous Over Long Period", "500 to 200000")}
|
|
|
|
{timeExample("Continuous Over Short Period", "0.0001 to 0.001")}
|
|
|
|
{timeExample(
|
|
|
|
"Continuous Over Very Long Period",
|
|
|
|
"500 to 20000000000000",
|
2020-03-04 10:27:50 +00:00
|
|
|
)}
|
2020-03-04 11:08:50 +00:00
|
|
|
{timeExample("Discrete", "floor(5 to 20)")}
|
|
|
|
{timeExample("Mixed", "mm(5 to 20, floor(5 to 20), [.5,.5])")}
|
|
|
|
{timeExample(
|
|
|
|
"Mixed Over Long Period",
|
|
|
|
"mm(500 to 2000, floor(50 to 2000), [.5,.5])",
|
2020-03-04 10:27:50 +00:00
|
|
|
)}
|
2020-03-04 11:08:50 +00:00
|
|
|
{timeExample(
|
|
|
|
"Mixed Over Very Long Period",
|
|
|
|
"mm(500 to 200000, floor(50 to 200000), [.5,.5])",
|
2020-03-04 10:27:50 +00:00
|
|
|
)}
|
2020-02-19 22:28:16 +00:00
|
|
|
</div>
|
2020-02-17 21:52:21 +00:00
|
|
|
</div>;
|
|
|
|
|
2020-03-04 10:27:50 +00:00
|
|
|
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
|