diff --git a/src/compute_constrained_bayes b/src/compute_constrained_bayes index 0b09fba..9fb4943 100755 Binary files a/src/compute_constrained_bayes and b/src/compute_constrained_bayes differ diff --git a/src/compute_constrained_bayes.nim b/src/compute_constrained_bayes.nim index cc1f36d..594370c 100644 --- a/src/compute_constrained_bayes.nim +++ b/src/compute_constrained_bayes.nim @@ -163,7 +163,7 @@ proc jitBayesLoop( ## Infrabayesianism -proc miniInfraBayes( +proc miniInfraBayesArgminMaxLoss( seqs: seq[seq[string]], observations: seq[string], n_observations_seen: int, @@ -195,18 +195,29 @@ proc miniInfraBayes( proc getEvens(xs: seq[string]): seq[string] = var evens: seq[string] for i,x in xs: - if i%2 == 0: + if i mod 2 == 0: evens.add(x) return evens proc getOdds(xs: seq[string]): seq[string] = var odds: seq[string] for i,x in xs: - if i%2 == 1: + if i mod 2 == 1: odds.add(x) return odds -proc miniInfraBayes2( +proc interleave(xs: seq[string], ys: seq[string]): seq[string] = + if xs.len != ys.len: + echo "Interleaved sequences have to have the same length; returning empty sequence." + return @[] + else: + var zs: seq[string] + for i in 0..