Minor fixes
This commit is contained in:
parent
8c625a6803
commit
2a9b83b16c
|
@ -1,30 +1,87 @@
|
||||||
// "mm(floor(uniform(30,35)), normal(50,20), [.25,.5])",
|
// "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(floor(normal(28,4)), normal(32,2), uniform(20,24), [.5,.2,.1])",
|
||||||
let timeVector: TimeTypes.timeVector = {
|
|
||||||
zero: MomentRe.momentNow(),
|
|
||||||
unit: `years,
|
|
||||||
};
|
|
||||||
|
|
||||||
let timeDist =
|
let timeDist =
|
||||||
DistPlusIngredients.make(
|
DistPlusIngredients.make(
|
||||||
~guesstimatorString="mm(floor(10 to 15), 10 to 11, [.9,.1])",
|
~guesstimatorString="mm(floor(10 to 15), 10 to 11, [.9,.1])",
|
||||||
~domain=Complete,
|
~domain=Complete,
|
||||||
~unit=DistTypes.TimeDistribution(timeVector),
|
~unit=
|
||||||
|
DistTypes.TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
|
||||||
(),
|
(),
|
||||||
)
|
);
|
||||||
|
|
||||||
|
let setup = dist =>
|
||||||
|
dist
|
||||||
|> DistPlusIngredients.toDistPlus(~sampleCount=5000, ~outputXYPoints=1000);
|
|> DistPlusIngredients.toDistPlus(~sampleCount=5000, ~outputXYPoints=1000);
|
||||||
|
|
||||||
let distributions = () =>
|
let distributions = () =>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<h2> {"Basic Mixed Distribution" |> ReasonReact.string} </h2>
|
<h2> {"Single-Discrete" |> ReasonReact.string} </h2>
|
||||||
{timeDist
|
{setup(
|
||||||
|> E.O.fmap(
|
DistPlusIngredients.make(
|
||||||
Distributions.DistPlus.T.scaleToIntegralSum(~intendedSum=1.0),
|
~guesstimatorString="floor(10 to 14)",
|
||||||
|
~domain=Complete,
|
||||||
|
(),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
|> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
||||||
<h2> {"Simple Continuous" |> ReasonReact.string} </h2>
|
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
|
// |> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// (),
|
||||||
|
// ~domain=Complete,
|
||||||
|
// ~guesstimatorString="(5 to 10)",
|
||||||
|
// DistPlusIngredients.make(
|
||||||
|
// {setup(
|
||||||
|
// <h2> {"Continuous Only" |> ReasonReact.string} </h2>
|
||||||
|
// |> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// (),
|
||||||
|
// ~domain=Complete,
|
||||||
|
// ~guesstimatorString="floor(5 to 10)",
|
||||||
|
// DistPlusIngredients.make(
|
||||||
|
// {setup(
|
||||||
|
// <h2> {"Discrete Only" |> ReasonReact.string} </h2>
|
||||||
|
// |> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// (),
|
||||||
|
// ~domain=Complete,
|
||||||
|
// ~guesstimatorString="mm(floor(10 to 15), 10 to 11, [.9,.1])",
|
||||||
|
// DistPlusIngredients.make(
|
||||||
|
// {setup(
|
||||||
|
// <h2> {"Simple Mixed Distribution" |> ReasonReact.string} </h2>
|
||||||
|
// |> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// (),
|
||||||
|
// }),
|
||||||
|
// unit: `days,
|
||||||
|
// zero: MomentRe.momentNow(),
|
||||||
|
// DistTypes.TimeDistribution({
|
||||||
|
// ~unit=
|
||||||
|
// ~domain=Complete,
|
||||||
|
// ~guesstimatorString="mm(floor(10 to 15), 10 to 11, [.9,.1])",
|
||||||
|
// DistPlusIngredients.make(
|
||||||
|
// {setup(
|
||||||
|
// <h2> {"Complex Distribution Days" |> ReasonReact.string} </h2>
|
||||||
|
// |> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// (),
|
||||||
|
// }),
|
||||||
|
// unit: `years,
|
||||||
|
// zero: MomentRe.momentNow(),
|
||||||
|
// DistTypes.TimeDistribution({
|
||||||
|
// ~unit=
|
||||||
|
// ~domain=Complete,
|
||||||
|
// ~guesstimatorString="mm(floor(10 to 15), 10 to 11, [.9,.1])",
|
||||||
|
// DistPlusIngredients.make(
|
||||||
|
// {setup(
|
||||||
|
// <h2> {"Complex Distribution" |> ReasonReact.string} </h2>
|
||||||
|
|
||||||
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
|
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
|
|
@ -32,6 +32,7 @@ module IntegralChart = {
|
||||||
let continuous =
|
let continuous =
|
||||||
integral
|
integral
|
||||||
|> T.toContinuous
|
|> T.toContinuous
|
||||||
|
|> E.O.bind(_, Distributions.Continuous.toLinear)
|
||||||
|> E.O.fmap(Distributions.Continuous.getShape);
|
|> E.O.fmap(Distributions.Continuous.getShape);
|
||||||
let minX = T.minX(integral);
|
let minX = T.minX(integral);
|
||||||
let maxX = T.maxX(integral);
|
let maxX = T.maxX(integral);
|
||||||
|
|
|
@ -18,8 +18,7 @@ let toDistPlus =
|
||||||
~outputXYPoints,
|
~outputXYPoints,
|
||||||
(),
|
(),
|
||||||
);
|
);
|
||||||
Js.log2("Line 21 with shape:", shape);
|
let distPlus =
|
||||||
let ss =
|
|
||||||
shape
|
shape
|
||||||
|> E.O.fmap(
|
|> E.O.fmap(
|
||||||
Distributions.DistPlus.make(
|
Distributions.DistPlus.make(
|
||||||
|
@ -29,6 +28,9 @@ let toDistPlus =
|
||||||
~guesstimatorString=None,
|
~guesstimatorString=None,
|
||||||
(),
|
(),
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
|> E.O.fmap(
|
||||||
|
Distributions.DistPlus.T.scaleToIntegralSum(~intendedSum=1.0),
|
||||||
);
|
);
|
||||||
ss;
|
distPlus;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user