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


Java LocalizedFormats.NO_DEGREES_OF_FREEDOM属性代码示例

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


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

示例1: guessParametersErrors

/**
 * <p>
 * Returns an estimate of the standard deviation of each parameter. The
 * returned values are the so-called (asymptotic) standard errors on the
 * parameters, defined as {@code sd(a[i]) = sqrt(S / (n - m) * C[i][i])},
 * where {@code a[i]} is the optimized value of the {@code i}-th parameter,
 * {@code S} is the minimized value of the sum of squares objective function
 * (as returned by {@link #getChiSquare()}), {@code n} is the number of
 * observations, {@code m} is the number of parameters and {@code C} is the
 * covariance matrix.
 * </p>
 * <p>
 * See also
 * <a href="http://en.wikipedia.org/wiki/Least_squares">Wikipedia</a>,
 * or
 * <a href="http://mathworld.wolfram.com/LeastSquaresFitting.html">MathWorld</a>,
 * equations (34) and (35) for a particular case.
 * </p>
 *
 * @return an estimate of the standard deviation of the optimized parameters
 * @throws org.apache.commons.math3.linear.SingularMatrixException
 * if the covariance matrix cannot be computed.
 * @throws NumberIsTooSmallException if the number of degrees of freedom is not
 * positive, i.e. the number of measurements is less or equal to the number of
 * parameters.
 * @deprecated as of version 3.1, {@link #computeSigma(double[],double)} should be used
 * instead. It should be emphasized that {@code guessParametersErrors} and
 * {@code computeSigma} are <em>not</em> strictly equivalent.
 */
@Deprecated
public double[] guessParametersErrors() {
    if (rows <= cols) {
        throw new NumberIsTooSmallException(LocalizedFormats.NO_DEGREES_OF_FREEDOM,
                                            rows, cols, false);
    }
    double[] errors = new double[cols];
    final double c = FastMath.sqrt(getChiSquare() / (rows - cols));
    double[][] covar = computeCovariances(point, 1e-14);
    for (int i = 0; i < errors.length; ++i) {
        errors[i] = FastMath.sqrt(covar[i][i]) * c;
    }
    return errors;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:43,代码来源:AbstractLeastSquaresOptimizer.java


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