@@ -0,0 +1,2421 @@
+package de.lmu.ifi.dbs.elki.math.statistics.distribution.estimator;%0A%0A/*%0A This file is part of ELKI:%0A Environment for Developing KDD-Applications Supported by Index-Structures%0A%0A Copyright (C) 2013%0A Ludwig-Maximilians-Universit%C3%A4t M%C3%BCnchen%0A Lehr- und Forschungseinheit f%C3%BCr Datenbanksysteme%0A ELKI Development Team%0A%0A This program is free software: you can redistribute it and/or modify%0A it under the terms of the GNU Affero General Public License as published by%0A the Free Software Foundation, either version 3 of the License, or%0A (at your option) any later version.%0A%0A This program is distributed in the hope that it will be useful,%0A but WITHOUT ANY WARRANTY; without even the implied warranty of%0A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A GNU Affero General Public License for more details.%0A%0A You should have received a copy of the GNU Affero General Public License%0A along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Aimport de.lmu.ifi.dbs.elki.math.statistics.distribution.WaldDistribution;%0Aimport de.lmu.ifi.dbs.elki.utilities.datastructures.arraylike.NumberArrayAdapter;%0Aimport de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizer;%0A%0A/**%0A * Estimate parameter of the Wald distribution.%0A * %0A * @author Erich Schubert%0A * %0A * @apiviz.has WaldDistribution%0A */%0Apublic class WaldMLEstimator implements DistributionEstimator%3CWaldDistribution%3E %7B%0A  /**%0A   * Static instance.%0A   */%0A  public static final WaldMLEstimator STATIC = new WaldMLEstimator();%0A%0A  @Override%0A  public %3CA%3E WaldDistribution estimate(A data, NumberArrayAdapter%3C?, A%3E adapter) %7B%0A    final int len = adapter.size(data);%0A    double mean = 0.;%0A    for(int i = 0; i %3C len; i++) %7B%0A      double v = adapter.getDouble(data, i);%0A      mean += v;%0A    %7D%0A    mean /= len;%0A    double invmean = len / mean;%0A    double invdev = 0.;%0A    for(int i = 0; i %3C len; i++) %7B%0A      double v = adapter.getDouble(data, i);%0A      if(v %3E 0.) %7B%0A        invdev += len / v - invmean;%0A      %7D%0A    %7D%0A    return new WaldDistribution(mean, 1. / invdev);%0A  %7D%0A%0A  @Override%0A  public Class%3C? super WaldDistribution%3E getDistributionClass() %7B%0A    return WaldDistribution.class;%0A  %7D%0A%0A  /**%0A   * Parameterization class.%0A   * %0A   * @author Erich Schubert%0A   * %0A   * @apiviz.exclude%0A   */%0A  public static class Parameterizer extends AbstractParameterizer %7B%0A    @Override%0A    protected WaldMLEstimator makeInstance() %7B%0A      return STATIC;%0A    %7D%0A  %7D%0A%7D%0A

Add estimator for Wald, untested.