use of org.apache.commons.math3.distribution.GeometricDistribution in project presto by prestodb.
the class TestTDigestFunctions method testGeometricDistribution.
@Test(enabled = false)
public void testGeometricDistribution() {
int trials = 10;
for (int k = 1; k < trials; k++) {
TDigest tDigest = createTDigest(STANDARD_COMPRESSION_FACTOR);
GeometricDistribution geometric = new GeometricDistribution(k * 0.1);
List<Integer> list = new ArrayList<>();
for (int i = 0; i < NUMBER_OF_ENTRIES; i++) {
int sample = geometric.sample();
tDigest.add(sample);
list.add(sample);
}
Collections.sort(list);
for (int i = 0; i < quantiles.length; i++) {
assertDiscreteQuantileWithinBound(quantiles[i], STANDARD_ERROR, list, tDigest);
}
}
}
use of org.apache.commons.math3.distribution.GeometricDistribution in project presto by prestodb.
the class TestTDigest method testGeometricDistribution.
@Test(enabled = false)
public void testGeometricDistribution() {
int trials = 10;
for (int k = 1; k < trials; k++) {
TDigest tDigest = createTDigest(STANDARD_COMPRESSION_FACTOR);
GeometricDistribution geometric = new GeometricDistribution(k * 0.1);
List<Integer> list = new ArrayList<>();
for (int i = 0; i < NUMBER_OF_ENTRIES; i++) {
int sample = geometric.sample();
tDigest.add(sample);
list.add(sample);
}
assertSumInts(list, tDigest);
Collections.sort(list);
for (int i = 0; i < quantile.length; i++) {
assertDiscreteWithinBound(quantile[i], STANDARD_ERROR, list, tDigest);
}
}
}
Aggregations