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