docs: public OutlierResult run(Database database, Relation<O> relation) {
      // Get a nearest neighbor query on the relation.
      KNNQuery<O> knnq = QueryUtil.getKNNQuery(relation, getDistanceFunction(), k);
      // Output data storage
      WritableDoubleDataStore scores = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_DB);
      // Track minimum and maximum scores
      DoubleMinMax minmax = new DoubleMinMax();
  
      // Iterate over all objects
      for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
        KNNList neighbors = knnq.getKNNForDBID(iter, k);
        // Aggregate distances
        MeanVariance mv = new MeanVariance();
        for(DoubleDBIDListIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) {
          // Skip the object itself. The 0 is not very informative.
          if(DBIDUtil.equal(iter, neighbor)) {
            continue;
          }
          mv.put(neighbor.doubleValue());
        }
        // Store score
        scores.putDouble(iter, mv.getSampleStddev());
      }
  
      // Wrap the result in the standard containers
      // Actual min-max, theoretical min-max!
      OutlierScoreMeta meta = new BasicOutlierScoreMeta(minmax.getMin(), minmax.getMax(), 0, Double.POSITIVE_INFINITY);
      DoubleRelation rel = new MaterializedDoubleRelation(relation.getDBIDs(), "stddev-outlier", scores);
      return new OutlierResult(meta, rel);
    }