本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}