2020-02-17 21:52:21 +00:00
|
|
|
let data: DistributionTypes.xyShape = {
|
2020-02-17 22:53:39 +00:00
|
|
|
xs: [|1., 10., 10., 200., 250., 292., 330.|],
|
|
|
|
ys: [|0.0, 0.0, 0.1, 0.3, 0.5, 0.2, 0.1|],
|
2020-02-17 21:52:21 +00:00
|
|
|
};
|
|
|
|
|
2020-02-17 22:53:39 +00:00
|
|
|
let mixedDist =
|
|
|
|
GenericDistribution.make(
|
2020-02-18 13:23:02 +00:00
|
|
|
~generationSource=
|
2020-02-18 19:01:11 +00:00
|
|
|
GuesstimatorString(
|
2020-02-18 19:18:07 +00:00
|
|
|
"mm(floor(uniform(20, 30)), normal(50,10), [.5,.5])",
|
2020-02-18 19:01:11 +00:00
|
|
|
),
|
2020-02-17 22:53:39 +00:00
|
|
|
~probabilityType=Pdf,
|
|
|
|
~domain=Complete,
|
2020-02-19 07:54:40 +00:00
|
|
|
~unit=UnspecifiedDistribution,
|
2020-02-17 22:53:39 +00:00
|
|
|
(),
|
|
|
|
)
|
2020-02-18 13:23:02 +00:00
|
|
|
|> GenericDistribution.renderIfNeeded(~sampleCount=1000);
|
2020-02-17 22:53:39 +00:00
|
|
|
|
|
|
|
let timeDist =
|
|
|
|
GenericDistribution.make(
|
2020-02-20 10:57:01 +00:00
|
|
|
~generationSource=
|
|
|
|
GuesstimatorString(
|
|
|
|
"mm(floor(uniform(40, 50)), normal(50,10), [.5,.5])",
|
|
|
|
),
|
2020-02-17 22:53:39 +00:00
|
|
|
~probabilityType=Pdf,
|
|
|
|
~domain=Complete,
|
2020-02-19 12:06:41 +00:00
|
|
|
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
|
2020-02-17 22:53:39 +00:00
|
|
|
(),
|
|
|
|
)
|
2020-02-18 13:23:02 +00:00
|
|
|
|> GenericDistribution.renderIfNeeded(~sampleCount=1000);
|
2020-02-17 22:53:39 +00:00
|
|
|
|
|
|
|
let domainLimitedDist =
|
|
|
|
GenericDistribution.make(
|
|
|
|
~generationSource=GuesstimatorString("mm(3, normal(5,1), [.5,.5])"),
|
|
|
|
~probabilityType=Pdf,
|
|
|
|
~domain=RightLimited({xPoint: 6.0, excludingProbabilityMass: 0.3}),
|
2020-02-19 07:54:40 +00:00
|
|
|
~unit=UnspecifiedDistribution,
|
2020-02-17 22:53:39 +00:00
|
|
|
(),
|
|
|
|
)
|
2020-02-18 13:23:02 +00:00
|
|
|
|> GenericDistribution.renderIfNeeded(~sampleCount=1000);
|
2020-02-17 22:53:39 +00:00
|
|
|
|
|
|
|
let distributions = () =>
|
2020-02-17 21:52:21 +00:00
|
|
|
<div>
|
|
|
|
<div>
|
2020-02-19 22:28:16 +00:00
|
|
|
<h2> {"Basic Mixed Distribution" |> ReasonReact.string} </h2>
|
|
|
|
{timeDist
|
2020-02-20 10:57:01 +00:00
|
|
|
|> E.O.bind(_, GenericDistribution.normalize)
|
2020-02-19 22:28:16 +00:00
|
|
|
|> E.O.React.fmapOrNull(dist => <GenericDistributionChart dist />)}
|
|
|
|
<h2> {"Simple Continuous" |> ReasonReact.string} </h2>
|
|
|
|
</div>
|
2020-02-17 21:52:21 +00:00
|
|
|
</div>;
|
2020-02-19 22:28:16 +00:00
|
|
|
// <GenericDistributionChart dist=mixedDist />
|
2020-02-18 19:01:11 +00:00
|
|
|
// <div>
|
|
|
|
// <h2> {"Time Distribution" |> ReasonReact.string} </h2>
|
|
|
|
// <GenericDistributionChart dist=timeDist />
|
|
|
|
// </div>
|
|
|
|
// <div>
|
|
|
|
// <h2> {"Domain Limited Distribution" |> ReasonReact.string} </h2>
|
|
|
|
// <GenericDistributionChart dist=domainLimitedDist />
|
|
|
|
// </div>
|
2020-02-17 21:52:21 +00:00
|
|
|
|
2020-02-17 22:53:39 +00:00
|
|
|
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
|