percentiles.put(Double.parseDouble(entry.getKey()), (Double) entry.getValue());
}
System.out.println("Expected percentiles: " + percentiles);
System.out.println();
SearchResponse resp = client.prepareSearch(d.indexName()).setSearchType(SearchType.COUNT).addAggregation(percentiles("pcts").field("v").percentiles(PERCENTILES)).execute().actionGet();
Percentiles pcts = resp.getAggregations().get("pcts");
Map<Double, Double> asMap = Maps.newLinkedHashMap();
double sumOfErrorSquares = 0;
for (Percentile percentile : pcts) {
asMap.put(percentile.getPercent(), percentile.getValue());
double error = percentile.getValue() - percentiles.get(percentile.getPercent());