Package org.apache.commons.math.optimization

Examples of org.apache.commons.math.optimization.OptimizationException


     * lesser or equal to number of parameters)
     */
    public double[] guessParametersErrors()
        throws FunctionEvaluationException, OptimizationException {
        if (rows <= cols) {
            throw new OptimizationException(
                    "no degrees of freedom ({0} measurements, {1} parameters)",
                    rows, cols);
        }
        double[] errors = new double[cols];
        final double c = Math.sqrt(getChiSquare() / (rows - cols));
View Full Code Here


                                            final double[] target, final double[] weights,
                                            final double[] startPoint)
        throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {

        if (target.length != weights.length) {
            throw new OptimizationException("dimension mismatch {0} != {1}",
                                            target.length, weights.length);
        }

        // reset counters
        iterations           = 0;
View Full Code Here

     * of iterations is exceeded
     */
    protected void incrementIterationsCounter()
        throws OptimizationException {
        if (++iterations > maxIterations) {
            throw new OptimizationException(new MaxIterationsExceededException(maxIterations));
        }
    }
View Full Code Here

                for (int i = 0; i < cols; ++i) {
                    point[i] += dX[i];
                }

            } catch(InvalidMatrixException e) {
                throw new OptimizationException("unable to solve: singular problem");
            }

            // check convergence
            if (previous != null) {
                converged = checker.converged(getIterations(), previous, current);
View Full Code Here

        // compute the amplitude and pulsation coefficients
        double c1 = sy2 * sxz - sxy * syz;
        double c2 = sxy * sxz - sx2 * syz;
        double c3 = sx2 * sy2 - sxy * sxy;
        if ((c1 / c2 < 0.0) || (c2 / c3 < 0.0)) {
            throw new OptimizationException("unable to first guess the harmonic coefficients");
        }
        a     = Math.sqrt(c1 / c2);
        omega = Math.sqrt(c2 / c3);

    }
View Full Code Here

            // shall we compute the first guess of the parameters ourselves ?
            if (parameters == null) {
                final WeightedObservedPoint[] observations = fitter.getObservations();
                if (observations.length < 4) {
                    throw new OptimizationException("sample contains {0} observed points, at least {1} are required",
                                                    observations.length, 4);
                }

                HarmonicCoefficientsGuesser guesser = new HarmonicCoefficientsGuesser(observations);
                guesser.guess();
View Full Code Here

     * of iterations is exceeded
     */
    protected void incrementIterationsCounter()
        throws OptimizationException {
        if (++iterations > maxIterations) {
            throw new OptimizationException(new MaxIterationsExceededException(maxIterations));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math.optimization.OptimizationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.