FloatCdf -> GuesstimatorDist
This commit is contained in:
parent
d71d157741
commit
c6727c40a5
|
@ -27,7 +27,7 @@ type otherSettings = {currentYear: int};
|
|||
let sharesOutstanding = (price, marketCap) =>
|
||||
switch (price, marketCap) {
|
||||
| (Some(price), Some(marketCap)) =>
|
||||
Some(FloatCdf.divide(marketCap, price))
|
||||
Some(GuesstimatorDist.divide(marketCap, price))
|
||||
| _ => None
|
||||
};
|
||||
|
||||
|
@ -42,11 +42,15 @@ let rec run =
|
|||
| (SHARE_PRICE, year, Some(price), _) when year > 2019 && year < 2030 =>
|
||||
let diffYears = year - otherSettings.currentYear;
|
||||
let diffPerYear = 0.1;
|
||||
Some(FloatCdf.normal(price, float_of_int(diffYears) *. diffPerYear));
|
||||
Some(
|
||||
GuesstimatorDist.normal(price, float_of_int(diffYears) *. diffPerYear),
|
||||
);
|
||||
| (MARKET_CAP, year, _, Some(price)) when year > 2019 && year < 2030 =>
|
||||
let diffYears = year - otherSettings.currentYear;
|
||||
let diffPerYear = 0.1;
|
||||
Some(FloatCdf.normal(price, float_of_int(diffYears) *. diffPerYear));
|
||||
Some(
|
||||
GuesstimatorDist.normal(price, float_of_int(diffYears) *. diffPerYear),
|
||||
);
|
||||
| (SHARES_OUTSTANDING, year, _, _) when year > 2019 && year < 2030 =>
|
||||
let price = run(company, year, SHARE_PRICE, otherSettings);
|
||||
let marketCap = run(company, year, MARKET_CAP, otherSettings);
|
||||
|
|
|
@ -78,7 +78,7 @@ module Model = {
|
|||
let yearDiff = MomentRe.diff(dateTime, currentDateTime, `days) /. 365.;
|
||||
let meanDiff = Js.Math.pow_float(~base=y.meanDiff, ~exp=yearDiff);
|
||||
let stdDevDiff = Js.Math.pow_float(~base=y.meanDiff, ~exp=yearDiff);
|
||||
FloatCdf.logNormal(
|
||||
GuesstimatorDist.logNormal(
|
||||
currentValue *. meanDiff,
|
||||
firstYearStdDev *. stdDevDiff,
|
||||
);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// ~generationSource=GuesstimatorString(,
|
||||
module Model = {
|
||||
let make = (currentDateTime: MomentRe.Moment.t) => {
|
||||
let genericDistribution =
|
||||
GenericDistribution.make(
|
||||
~generationSource=GuesstimatorString(FloatCdf.logNormal(20., 3.)),
|
||||
~generationSource=
|
||||
GuesstimatorString(GuesstimatorDist.logNormal(20., 3.)),
|
||||
~probabilityType=Cdf,
|
||||
~domain=RightLimited({xPoint: 200., excludingProbabilityMass: 0.3}),
|
||||
~unit=Time({zero: currentDateTime, unit: `years}),
|
||||
|
|
Loading…
Reference in New Issue
Block a user