Merge pull request #321 from quantified-uncertainty/cauchy
hotfix: `cauchy` in binary dist constructors
This commit is contained in:
commit
6c43907ba9
|
@ -2,3 +2,5 @@ dist
|
||||||
lib
|
lib
|
||||||
*.bs.js
|
*.bs.js
|
||||||
*.gen.tsx
|
*.gen.tsx
|
||||||
|
.nyc_output/
|
||||||
|
coverage/
|
||||||
|
|
|
@ -86,7 +86,9 @@ module Exponential = {
|
||||||
|
|
||||||
module Cauchy = {
|
module Cauchy = {
|
||||||
type t = cauchy
|
type t = cauchy
|
||||||
let make = (local, scale): symbolicDist => #Cauchy({local: local, scale: scale})
|
let make = (local, scale): result<symbolicDist, string> => Ok(
|
||||||
|
#Cauchy({local: local, scale: scale}),
|
||||||
|
)
|
||||||
let pdf = (x, t: t) => Jstat.Cauchy.pdf(x, t.local, t.scale)
|
let pdf = (x, t: t) => Jstat.Cauchy.pdf(x, t.local, t.scale)
|
||||||
let cdf = (x, t: t) => Jstat.Cauchy.cdf(x, t.local, t.scale)
|
let cdf = (x, t: t) => Jstat.Cauchy.cdf(x, t.local, t.scale)
|
||||||
let inv = (p, t: t) => Jstat.Cauchy.inv(p, t.local, t.scale)
|
let inv = (p, t: t) => Jstat.Cauchy.inv(p, t.local, t.scale)
|
||||||
|
|
|
@ -149,6 +149,7 @@ module SymbolicConstructors = {
|
||||||
| "uniform" => Ok(SymbolicDist.Uniform.make)
|
| "uniform" => Ok(SymbolicDist.Uniform.make)
|
||||||
| "beta" => Ok(SymbolicDist.Beta.make)
|
| "beta" => Ok(SymbolicDist.Beta.make)
|
||||||
| "lognormal" => Ok(SymbolicDist.Lognormal.make)
|
| "lognormal" => Ok(SymbolicDist.Lognormal.make)
|
||||||
|
| "cauchy" => Ok(SymbolicDist.Cauchy.make)
|
||||||
| "to" => Ok(SymbolicDist.From90thPercentile.make)
|
| "to" => Ok(SymbolicDist.From90thPercentile.make)
|
||||||
| _ => Error("Unreachable state")
|
| _ => Error("Unreachable state")
|
||||||
}
|
}
|
||||||
|
@ -182,7 +183,7 @@ let dispatchToGenericOutput = (call: ExpressionValue.functionCall): option<
|
||||||
->E.R.bind(r => r(f1))
|
->E.R.bind(r => r(f1))
|
||||||
->SymbolicConstructors.symbolicResultToOutput
|
->SymbolicConstructors.symbolicResultToOutput
|
||||||
| (
|
| (
|
||||||
("normal" | "uniform" | "beta" | "lognormal" | "to") as fnName,
|
("normal" | "uniform" | "beta" | "lognormal" | "cauchy" | "to") as fnName,
|
||||||
[EvNumber(f1), EvNumber(f2)],
|
[EvNumber(f1), EvNumber(f2)],
|
||||||
) =>
|
) =>
|
||||||
SymbolicConstructors.twoFloat(fnName)
|
SymbolicConstructors.twoFloat(fnName)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user