当前位置: 首页>>代码示例>>Java>>正文


Java LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL属性代码示例

本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL属性的具体用法?Java LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL怎么用?Java LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.math3.exception.util.LocalizedFormats的用法示例。


在下文中一共展示了LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkParameters

/**
 * Verifies that parameters satisfy preconditions.
 *
 * @param numberOfTrials number of trials (must be positive)
 * @param numberOfSuccesses number of successes (must not exceed numberOfTrials)
 * @param confidenceLevel confidence level (must be strictly between 0 and 1)
 * @throws NotStrictlyPositiveException if {@code numberOfTrials <= 0}.
 * @throws NotPositiveException if {@code numberOfSuccesses < 0}.
 * @throws NumberIsTooLargeException if {@code numberOfSuccesses > numberOfTrials}.
 * @throws OutOfRangeException if {@code confidenceLevel} is not in the interval {@code (0, 1)}.
 */
static void checkParameters(int numberOfTrials, int numberOfSuccesses, double confidenceLevel) {
    if (numberOfTrials <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_TRIALS, numberOfTrials);
    }
    if (numberOfSuccesses < 0) {
        throw new NotPositiveException(LocalizedFormats.NEGATIVE_NUMBER_OF_SUCCESSES, numberOfSuccesses);
    }
    if (numberOfSuccesses > numberOfTrials) {
        throw new NumberIsTooLargeException(LocalizedFormats.NUMBER_OF_SUCCESS_LARGER_THAN_POPULATION_SIZE,
                                            numberOfSuccesses, numberOfTrials, true);
    }
    if (confidenceLevel <= 0 || confidenceLevel >= 1) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL,
                                      confidenceLevel, 0, 1);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:27,代码来源:IntervalUtils.java

示例2: checkParameters

/**
 * Verifies that (lower, upper) is a valid non-empty interval and confidence
 * is strictly between 0 and 1.
 *
 * @param lower lower endpoint
 * @param upper upper endpoint
 * @param confidence confidence level
 */
private void checkParameters(double lower, double upper, double confidence) {
    if (lower >= upper) {
        throw new MathIllegalArgumentException(LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND, lower, upper);
    }
    if (confidence <= 0 || confidence >= 1) {
        throw new MathIllegalArgumentException(LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL, confidence, 0, 1);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:16,代码来源:ConfidenceInterval.java


注:本文中的org.apache.commons.math3.exception.util.LocalizedFormats.OUT_OF_BOUNDS_CONFIDENCE_LEVEL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。