tweak: delete higher level match in mixture function
This commit is contained in:
parent
ce119253b7
commit
4983699308
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -41,11 +41,10 @@ let sampleTo low high =
|
||||||
let logstd = (loghigh -. loglow) /. (2.0 -. normal_95_ci_length ) in
|
let logstd = (loghigh -. loglow) /. (2.0 -. normal_95_ci_length ) in
|
||||||
sampleLognormal logmean logstd
|
sampleLognormal logmean logstd
|
||||||
|
|
||||||
let (|>) x f = f x
|
|
||||||
let mixture (samplers: (unit -> float) array) (weights: float array): float option =
|
let mixture (samplers: (unit -> float) array) (weights: float array): float option =
|
||||||
match (Array.length samplers == Array.length weights) with
|
if (Array.length samplers == Array.length weights)
|
||||||
| false -> None
|
then None
|
||||||
| true ->
|
else
|
||||||
let normalized_weights = normalizeXs weights in
|
let normalized_weights = normalizeXs weights in
|
||||||
let cumsummed_normalized_weights = cumsumXs normalized_weights in
|
let cumsummed_normalized_weights = cumsumXs normalized_weights in
|
||||||
let p = sampleZeroToOne () in
|
let p = sampleZeroToOne () in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user