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


Java LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT属性代码示例

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


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

示例1: probability

/** {@inheritDoc} */
@Override
public double probability(double x0,
                          double x1)
    throws NumberIsTooLargeException {
    if (x0 > x1) {
        throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT,
                                            x0, x1, true);
    }
    if (x0 <= 0 || x1 <= 0) {
        return super.probability(x0, x1);
    }
    final double denom = shape * SQRT2;
    final double v0 = (FastMath.log(x0) - scale) / denom;
    final double v1 = (FastMath.log(x1) - scale) / denom;
    return 0.5 * Erf.erf(v0, v1);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:17,代码来源:LogNormalDistribution.java

示例2: cumulativeProbability

/**
 * {@inheritDoc}
 *
 * The default implementation uses the identity
 * <p>{@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)}</p>
 */
public double cumulativeProbability(int x0, int x1) throws NumberIsTooLargeException {
    if (x1 < x0) {
        throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT,
                x0, x1, true);
    }
    return cumulativeProbability(x1) - cumulativeProbability(x0);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:13,代码来源:AbstractIntegerDistribution.java

示例3: probability

/** {@inheritDoc} */
@Override
public double probability(double x0,
                          double x1)
    throws NumberIsTooLargeException {
    if (x0 > x1) {
        throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT,
                                            x0, x1, true);
    }
    final double denom = standardDeviation * SQRT2;
    final double v0 = (x0 - mean) / denom;
    final double v1 = (x1 - mean) / denom;
    return 0.5 * Erf.erf(v0, v1);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:14,代码来源:NormalDistribution.java

示例4: probability

/**
 * For a random variable {@code X} whose values are distributed according
 * to this distribution, this method returns {@code P(x0 < X <= x1)}.
 *
 * @param x0 Lower bound (excluded).
 * @param x1 Upper bound (included).
 * @return the probability that a random variable with this distribution
 * takes a value between {@code x0} and {@code x1}, excluding the lower
 * and including the upper endpoint.
 * @throws NumberIsTooLargeException if {@code x0 > x1}.
 *
 * The default implementation uses the identity
 * {@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)}
 *
 * @since 3.1
 */
public double probability(double x0,
                          double x1) {
    if (x0 > x1) {
        throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT,
                                            x0, x1, true);
    }
    return cumulativeProbability(x1) - cumulativeProbability(x0);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:24,代码来源:AbstractRealDistribution.java


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