本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.SIGNIFICANCE_LEVEL属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.SIGNIFICANCE_LEVEL属性的具体用法?Java LocalizedFormats.SIGNIFICANCE_LEVEL怎么用?Java LocalizedFormats.SIGNIFICANCE_LEVEL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.math3.exception.util.LocalizedFormats
的用法示例。
在下文中一共展示了LocalizedFormats.SIGNIFICANCE_LEVEL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSignificanceLevel
/**
* Check significance level.
*
* @param alpha significance level
* @throws OutOfRangeException if the significance level is out of bounds.
*/
private void checkSignificanceLevel(final double alpha)
throws OutOfRangeException {
if (alpha <= 0 || alpha > 0.5) {
throw new OutOfRangeException(LocalizedFormats.SIGNIFICANCE_LEVEL,
alpha, 0.0, 0.5);
}
}
示例2: getSlopeConfidenceInterval
/**
* Returns the half-width of a (100-100*alpha)% confidence interval for
* the slope estimate.
* <p>
* The (100-100*alpha)% confidence interval is </p>
* <p>
* <code>(getSlope() - getSlopeConfidenceInterval(),
* getSlope() + getSlopeConfidenceInterval())</code></p>
* <p>
* To request, for example, a 99% confidence interval, use
* <code>alpha = .01</code></p>
* <p>
* <strong>Usage Note</strong>:<br>
* The validity of this statistic depends on the assumption that the
* observations included in the model are drawn from a
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
* Bivariate Normal Distribution</a>.</p>
* <p>
* <strong> Preconditions:</strong><ul>
* <li>If there are fewer that <strong>three</strong> observations in the
* model, or if there is no variation in x, this returns
* <code>Double.NaN</code>.
* </li>
* <li><code>(0 < alpha < 1)</code>; otherwise an
* <code>OutOfRangeException</code> is thrown.
* </li></ul></p>
*
* @param alpha the desired significance level
* @return half-width of 95% confidence interval for the slope estimate
* @throws OutOfRangeException if the confidence interval can not be computed.
*/
public double getSlopeConfidenceInterval(final double alpha)
throws OutOfRangeException {
if (n < 3) {
return Double.NaN;
}
if (alpha >= 1 || alpha <= 0) {
throw new OutOfRangeException(LocalizedFormats.SIGNIFICANCE_LEVEL,
alpha, 0, 1);
}
// No advertised NotStrictlyPositiveException here - will return NaN above
TDistribution distribution = new TDistribution(n - 2);
return getSlopeStdErr() *
distribution.inverseCumulativeProbability(1d - alpha / 2d);
}