2020-02-17 21:52:21 +00:00
|
|
|
open ForetoldComponents.Base;
|
|
|
|
|
|
|
|
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(
|
|
|
|
~generationSource=GuesstimatorString("mm(3, normal(5,1), [.5,.5])"),
|
|
|
|
~probabilityType=Pdf,
|
|
|
|
~domain=Complete,
|
|
|
|
~unit=Unspecified,
|
|
|
|
(),
|
|
|
|
)
|
|
|
|
|> GenericDistribution.renderIfNeeded(~sampleCount=3000);
|
|
|
|
|
|
|
|
let timeDist =
|
|
|
|
GenericDistribution.make(
|
|
|
|
~generationSource=GuesstimatorString("mm(3, normal(5,1), [.5,.5])"),
|
|
|
|
~probabilityType=Pdf,
|
|
|
|
~domain=Complete,
|
|
|
|
~unit=Time({zero: MomentRe.momentNow(), unit: `years}),
|
|
|
|
(),
|
|
|
|
)
|
|
|
|
|> GenericDistribution.renderIfNeeded(~sampleCount=3000);
|
|
|
|
|
|
|
|
let domainLimitedDist =
|
|
|
|
GenericDistribution.make(
|
|
|
|
~generationSource=GuesstimatorString("mm(3, normal(5,1), [.5,.5])"),
|
|
|
|
~probabilityType=Pdf,
|
|
|
|
~domain=RightLimited({xPoint: 6.0, excludingProbabilityMass: 0.3}),
|
|
|
|
~unit=Unspecified,
|
|
|
|
(),
|
|
|
|
)
|
|
|
|
|> GenericDistribution.renderIfNeeded(~sampleCount=3000);
|
|
|
|
|
|
|
|
let distributions = () =>
|
2020-02-17 21:52:21 +00:00
|
|
|
<div>
|
|
|
|
<div>
|
2020-02-17 22:53:39 +00:00
|
|
|
<h2> {"Basic Mixed Distribution" |> ReasonReact.string} </h2>
|
|
|
|
<GenericDistributionChart dist=mixedDist />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h2> {"Time Distribution" |> ReasonReact.string} </h2>
|
|
|
|
<GenericDistributionChart dist=timeDist />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h2> {"Domain Limited Distribution" |> ReasonReact.string} </h2>
|
|
|
|
<GenericDistributionChart dist=domainLimitedDist />
|
2020-02-17 21:52:21 +00:00
|
|
|
</div>
|
|
|
|
</div>;
|
|
|
|
|
2020-02-17 22:53:39 +00:00
|
|
|
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
|