MapElement[] map = new MapElement[sampleData.size()];
// sort the samples by pdf
double maxPdf = Double.MIN_NORMAL;
for (int i = 0; i < sampleData.size(); i++) {
VectorWritable sample = new VectorWritable(sampleData.get(i));
double pdf = Math.abs(model.pdf(sample));
maxPdf = Math.max(maxPdf, pdf);
map[i] = new MapElement(pdf, docs[i]);
}
Arrays.sort(map);
for (int i = 0; i < map.length; i++) {