Skip to content

Commit 2e272a8

Browse files
committed
tidy up #28
1 parent 64e3a9e commit 2e272a8

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

src/main/java/beastlabs/math/distributions/WeightedDirichlet.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ private double calcLogP(List<Double> x) {
9999
weightsNormSumX += x.get(i) * weightsNorm[i];
100100
}
101101

102-
// the weight mean = sum(x[i] * weight[i]) / sum(weight[i])
103-
double weightedSumX = IntStream.range(0, x.size())
104-
.mapToDouble(i -> x.get(i) * weights[i]).sum();
105-
double weightedMeanX = weightedSumX / weightSum;
106-
107-
108-
109-
// (weightsNormSumX / dim) is the weighted mean
110102
if (Math.abs(weightsNormSumX / dim - expectedMean) > 1e-6) {
111103
throw new RuntimeException("The weighted mean (" + (weightsNormSumX / dim) + ") of values " + x +
112104
" must be same as the expected mean of values (" + expectedMean + ") !");

0 commit comments

Comments
 (0)