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

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

Introduction

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

Prototype

LocalizedFormats OUT_OF_BOUND_SIGNIFICANCE_LEVEL

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

Click Source Link

Usage

From source file:cz.cuni.mff.spl.evaluator.statistics.KolmogorovSmirnovTestFlag.java

/**
 * Performs a <a href="http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test"> Kolmogorov-Smirnov
 * test</a> evaluating the null hypothesis that {@code data} conforms to {@code distribution}.
 *
 * @param distribution reference distribution
 * @param data sample being being evaluated
 * @param alpha significance level of the test
 * @return true iff the null hypothesis that {@code data} is a sample from {@code distribution}
 *         can be rejected with confidence 1 - {@code alpha}
 * @throws InsufficientDataException if {@code data} does not have length at least 2
 * @throws NullArgumentException if {@code data} is null
 *//*from www .j a  v  a 2 s.com*/
public boolean kolmogorovSmirnovTest(RealDistribution distribution, double[] data, double alpha) {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL, alpha, 0, 0.5);
    }
    return kolmogorovSmirnovTest(distribution, data) < alpha;
}