Minor changes
This commit is contained in:
parent
4eb4247848
commit
5bd66be29e
|
@ -11,7 +11,7 @@ let logNormal = (mean: float, std: float) => {
|
||||||
Js.Float.(
|
Js.Float.(
|
||||||
{
|
{
|
||||||
let nMean = toPrecisionWithPrecision(Js.Math.log10(mean), ~digits=4);
|
let nMean = toPrecisionWithPrecision(Js.Math.log10(mean), ~digits=4);
|
||||||
let nStd = toPrecisionWithPrecision(std, ~digits=2);
|
let nStd = toPrecisionWithPrecision(Js.Math.log10(std), ~digits=2);
|
||||||
{j|lognormal($(nMean), $(nStd))|j};
|
{j|lognormal($(nMean), $(nStd))|j};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -58,7 +58,14 @@ module Value = {
|
||||||
| TimeLimitedDomainCdfLazy(r) =>
|
| TimeLimitedDomainCdfLazy(r) =>
|
||||||
let timeLimited = r(CdfLibrary.Distribution.fromString(_, 1000));
|
let timeLimited = r(CdfLibrary.Distribution.fromString(_, 1000));
|
||||||
let cdf = timeLimited.limitedDomainCdf.distribution;
|
let cdf = timeLimited.limitedDomainCdf.distribution;
|
||||||
<> <Chart height=100 data={cdf |> Types.toJs} /> </>;
|
<>
|
||||||
|
<Chart height=100 data={cdf |> Types.toJs} />
|
||||||
|
<Chart
|
||||||
|
height=100
|
||||||
|
data={cdf |> CdfLibrary.Distribution.toPdf |> Types.toJs}
|
||||||
|
/>
|
||||||
|
{FloatCdf.logNormal(50., 20.) |> ReasonReact.string}
|
||||||
|
</>;
|
||||||
| TimeLimitedDomainCdf(r) =>
|
| TimeLimitedDomainCdf(r) =>
|
||||||
let cdf: Types.distribution = r.limitedDomainCdf.distribution;
|
let cdf: Types.distribution = r.limitedDomainCdf.distribution;
|
||||||
<> <Chart height=100 data={cdf |> Types.toJs} /> </>;
|
<> <Chart height=100 data={cdf |> Types.toJs} /> </>;
|
||||||
|
|
|
@ -122,8 +122,14 @@ module Model = {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
| CHANCE_OF_EXISTENCE =>
|
| CHANCE_OF_EXISTENCE =>
|
||||||
let yearDiff = MomentRe.diff(dateTime, currentDateTime, `days) /. 365.;
|
let lazyDistribution = r =>
|
||||||
Prop.Value.Probability((100. -. yearDiff) /. 100.);
|
TimeLimitedDomainCdf.make(
|
||||||
|
~timeVector={zero: currentDateTime, unit: `years},
|
||||||
|
~distribution=r(FloatCdf.logNormal(10., 2.)),
|
||||||
|
~probabilityAtMaxX=0.7,
|
||||||
|
~maxX=`x(200.),
|
||||||
|
);
|
||||||
|
Prop.Value.TimeLimitedDomainCdfLazy(lazyDistribution);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@ module Model = {
|
||||||
let lazyDistribution = r =>
|
let lazyDistribution = r =>
|
||||||
TimeLimitedDomainCdf.make(
|
TimeLimitedDomainCdf.make(
|
||||||
~timeVector={zero: currentDateTime, unit: `years},
|
~timeVector={zero: currentDateTime, unit: `years},
|
||||||
~distribution=r("normal(50,30)"),
|
~distribution=r(FloatCdf.logNormal(20., 3.)),
|
||||||
~probabilityAtMaxX=0.7,
|
~probabilityAtMaxX=0.7,
|
||||||
~maxX=`x(200.),
|
~maxX=`x(200.),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user