squiggle/showcase/entries/Continuous.re

25 lines
777 B
ReasonML
Raw Normal View History

2020-02-20 12:54:45 +00:00
// "mm(floor(uniform(30,35)), normal(50,20), [.25,.5])",
2020-02-17 22:53:39 +00:00
let timeDist =
GenericDistribution.make(
2020-02-20 14:30:15 +00:00
~generationSource=
GuesstimatorString("mm(floor(normal(30,3)), normal(39,1), [.5,.5])"),
2020-02-17 22:53:39 +00:00
~probabilityType=Pdf,
~domain=Complete,
2020-02-20 12:54:45 +00:00
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `days}),
2020-02-17 22:53:39 +00:00
(),
)
|> GenericDistribution.toComplexPower(~sampleCount=1000);
2020-02-17 22:53:39 +00:00
let distributions = () =>
<div>
<div>
2020-02-19 22:28:16 +00:00
<h2> {"Basic Mixed Distribution" |> ReasonReact.string} </h2>
{timeDist
|> E.O.React.fmapOrNull(complexPower =>
<ComplexPowerChart complexPower />
)}
2020-02-19 22:28:16 +00:00
<h2> {"Simple Continuous" |> ReasonReact.string} </h2>
</div>
</div>;
2020-02-17 22:53:39 +00:00
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));