SymbolicDistFloat adjustment for choose in ExpressionTree

This commit is contained in:
Ozzie Gooen 2020-07-19 23:08:27 +01:00
parent 95b8ba2036
commit ac7b1ee9d5
2 changed files with 8 additions and 6 deletions

View File

@ -180,10 +180,10 @@ let make = () => {
unitType: "UnspecifiedDistribution",
zero: MomentRe.momentNow(),
unit: "days",
sampleCount: "3000",
outputXYPoints: "100",
downsampleTo: "100",
kernelWidth: "5",
sampleCount: "30000",
outputXYPoints: "1000",
downsampleTo: "",
kernelWidth: "",
},
(),
);

View File

@ -36,6 +36,8 @@ module AlgebraicCombination = {
let dLength = (r: DistTypes.discreteShape) =>
r.xyShape |> XYShape.T.length;
switch (t1, t2) {
| (`SymbolicDist(`Float(_)), _)
| (_, `SymbolicDist(`Float(_))) => `Analytical
| (`RenderedDist(Continuous(_)), `RenderedDist(Continuous(_))) => `Sampling
| (`RenderedDist(Discrete(m1)), `RenderedDist(Discrete(m2)))
when dLength(m1) * dLength(m2) > 1000 => `Analytical
@ -48,7 +50,7 @@ module AlgebraicCombination = {
| _ => `Sampling
};
};
let foo =
let combine =
(evaluationParams, algebraicOp, t1: node, t2: node)
: result(node, string) => {
E.R.merge(
@ -90,7 +92,7 @@ module AlgebraicCombination = {
_,
fun
| `SymbolicDist(_) as t => Ok(t)
| _ => foo(evaluationParams, algebraicOp, t1, t2),
| _ => combine(evaluationParams, algebraicOp, t1, t2),
);
};