We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64e3a9e commit 2e272a8Copy full SHA for 2e272a8
1 file changed
src/main/java/beastlabs/math/distributions/WeightedDirichlet.java
@@ -99,14 +99,6 @@ private double calcLogP(List<Double> x) {
99
weightsNormSumX += x.get(i) * weightsNorm[i];
100
}
101
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
110
if (Math.abs(weightsNormSumX / dim - expectedMean) > 1e-6) {
111
throw new RuntimeException("The weighted mean (" + (weightsNormSumX / dim) + ") of values " + x +
112
" must be same as the expected mean of values (" + expectedMean + ") !");
0 commit comments