docs: protected double computeNNForRealData(final KNNQuery<NumberVector> knnQuery, Relation<NumberVector> relation, final int dim) {
      double w = 0.;
      ModifiableDBIDs dataSampleIds = DBIDUtil.randomSample(relation.getDBIDs(), sampleSize, random);
      for(DBIDIter iter = dataSampleIds.iter(); iter.valid(); iter.advance()) {
        final double kdist = knnQuery.getKNNForDBID(iter, k + 1).getKNNDistance();
        w += MathUtil.powi(kdist, dim);
      }
      return w;
    }