Java Code Examples for org.apache.commons.math.exception.util.LocalizedFormats#OUT_OF_BOUND_SIGNIFICANCE_LEVEL

The following examples show how to use org.apache.commons.math.exception.util.LocalizedFormats#OUT_OF_BOUND_SIGNIFICANCE_LEVEL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param counts array representation of 2-way table
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean chiSquareTest(long[][] counts, double alpha)
throws MathException {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTest(counts) < alpha;
}
 
Example 2
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param observed1 array of observed frequency counts of the first data set
 * @param observed2 array of observed frequency counts of the second data set
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 * @since 1.2
 */
public boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2,
                                               double alpha)
    throws MathException {
    if (alpha <= 0 ||
        alpha > 0.5) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTestDataSetsComparison(observed1, observed2) < alpha;
}
 
Example 3
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param counts array representation of 2-way table
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean chiSquareTest(long[][] counts, double alpha)
throws MathException {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTest(counts) < alpha;
}
 
Example 4
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param observed1 array of observed frequency counts of the first data set
 * @param observed2 array of observed frequency counts of the second data set
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 * @since 1.2
 */
public boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2,
                                               double alpha)
    throws MathException {
    if (alpha <= 0 ||
        alpha > 0.5) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTestDataSetsComparison(observed1, observed2) < alpha;
}
 
Example 5
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param counts array representation of 2-way table
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean chiSquareTest(long[][] counts, double alpha)
throws MathException {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTest(counts) < alpha;
}
 
Example 6
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param observed1 array of observed frequency counts of the first data set
 * @param observed2 array of observed frequency counts of the second data set
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 * @since 1.2
 */
public boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2,
                                               double alpha)
    throws MathException {
    if (alpha <= 0 ||
        alpha > 0.5) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTestDataSetsComparison(observed1, observed2) < alpha;
}
 
Example 7
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * {@inheritDoc}
 * <p><strong>Note: </strong>This implementation rescales the
 * <code>expected</code> array if necessary to ensure that the sum of the
 * expected and observed counts are equal.</p>
 *
 * @param observed array of observed frequency counts
 * @param expected array of expected frequency counts
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean chiSquareTest(double[] expected, long[] observed,
                             double alpha)
    throws MathException {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTest(expected, observed) < alpha;
}
 
Example 8
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * {@inheritDoc}
 * <p><strong>Note: </strong>This implementation rescales the
 * <code>expected</code> array if necessary to ensure that the sum of the
 * expected and observed counts are equal.</p>
 *
 * @param observed array of observed frequency counts
 * @param expected array of expected frequency counts
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean chiSquareTest(double[] expected, long[] observed,
                             double alpha)
    throws MathException {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTest(expected, observed) < alpha;
}
 
Example 9
Source File: ChiSquareTestImpl.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * {@inheritDoc}
 * <p><strong>Note: </strong>This implementation rescales the
 * <code>expected</code> array if necessary to ensure that the sum of the
 * expected and observed counts are equal.</p>
 *
 * @param observed array of observed frequency counts
 * @param expected array of expected frequency counts
 * @param alpha significance level of the test
 * @return true iff null hypothesis can be rejected with confidence
 * 1 - alpha
 * @throws MathIllegalArgumentException if preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean chiSquareTest(double[] expected, long[] observed,
                             double alpha)
    throws MathException {
    if ((alpha <= 0) || (alpha > 0.5)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                                      alpha, 0, 0.5);
    }
    return chiSquareTest(expected, observed) < alpha;
}