Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#NO_DEGREES_OF_FREEDOM

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#NO_DEGREES_OF_FREEDOM . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Math_13_AbstractLeastSquaresOptimizer_t.java    From coming with MIT License 3 votes vote down vote up
/**
 * <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;
}
 
Example 2
Source File: Math_13_AbstractLeastSquaresOptimizer_s.java    From coming with MIT License 3 votes vote down vote up
/**
 * <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;
}
 
Example 3
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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;
}
 
Example 4
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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 #getSigma()} should be used
 * instead. It should be emphasized that {@link #guessParametersErrors()} and
 * {@link #getSigma()} 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 = getCovariances();
    for (int i = 0; i < errors.length; ++i) {
        errors[i] = FastMath.sqrt(covar[i][i]) * c;
    }
    return errors;
}
 
Example 5
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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 #getSigma()} should be used
 * instead. It should be emphasized that {@link #guessParametersErrors()} and
 * {@link #getSigma()} are <em>not</em> strictly equivalent.
 */
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 = getCovariances();
    for (int i = 0; i < errors.length; ++i) {
        errors[i] = FastMath.sqrt(covar[i][i]) * c;
    }
    return errors;
}
 
Example 6
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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;
}
 
Example 7
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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 #getSigma()} should be used
 * instead. It should be emphasized that {@link #guessParametersErrors()} and
 * {@link #getSigma()} are <em>not</em> strictly equivalent.
 */
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 = getCovariances();
    for (int i = 0; i < errors.length; ++i) {
        errors[i] = FastMath.sqrt(covar[i][i]) * c;
    }
    return errors;
}
 
Example 8
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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;
}
 
Example 9
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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;
}
 
Example 10
Source File: AbstractLeastSquaresOptimizer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <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;
}