double[] referenceScores = new double[gapMatrices.length];
for (int j = 0; j < gapMatrices.length; ++j) {
verbose("Clustering reference data %d \n", j);
Assignments result = DirectClustering.cluster(
gapMatrices[j], k, 1, function);
referenceScores[j] = Math.log(function.score());
referenceScore += referenceScores[j];
}
referenceScore /= numGaps;
// Compute the standard deviation for the reference scores.