Example usage for org.apache.commons.math3.exception.util LocalizedFormats ROBUSTNESS_ITERATIONS

List of usage examples for org.apache.commons.math3.exception.util LocalizedFormats ROBUSTNESS_ITERATIONS

Introduction

In this page you can find the example usage for org.apache.commons.math3.exception.util LocalizedFormats ROBUSTNESS_ITERATIONS.

Prototype

LocalizedFormats ROBUSTNESS_ITERATIONS

To view the source code for org.apache.commons.math3.exception.util LocalizedFormats ROBUSTNESS_ITERATIONS.

Click Source Link

Usage

From source file:cz.cuni.lf1.lge.ThunderSTORM.results.ModifiedLoess.java

/**
 * Construct a new {@link LoessInterpolator}
 * with given bandwidth, number of robustness iterations and accuracy.
 *
 * @param bandwidth  when computing the loess fit at
 * a particular point, this fraction of source points closest
 * to the current point is taken into account for computing
 * a least-squares regression.</br>
 * A sensible value is usually 0.25 to 0.5, the default value is
 * {@link #DEFAULT_BANDWIDTH}.//w  ww .  j a va  2  s  .com
 * @param robustnessIters This many robustness iterations are done.</br>
 * A sensible value is usually 0 (just the initial fit without any
 * robustness iterations) to 4, the default value is
 * {@link #DEFAULT_ROBUSTNESS_ITERS}.
 * @param accuracy If the median residual at a certain robustness iteration
 * is less than this amount, no more iterations are done.
 * @throws OutOfRangeException if bandwidth does not lie in the interval [0,1].
 * @throws NotPositiveException if {@code robustnessIters} is negative.
 * @see #LoessInterpolator(double, int)
 * @since 2.1
 */
public ModifiedLoess(double bandwidth, int robustnessIters, double accuracy)
        throws OutOfRangeException, NotPositiveException {
    if (bandwidth < 0 || bandwidth > 1) {
        throw new OutOfRangeException(LocalizedFormats.BANDWIDTH, bandwidth, 0, 1);
    }
    this.bandwidth = bandwidth;
    if (robustnessIters < 0) {
        throw new NotPositiveException(LocalizedFormats.ROBUSTNESS_ITERATIONS, robustnessIters);
    }
    this.robustnessIters = robustnessIters;
    this.accuracy = accuracy;
}