Package org.apache.commons.math3.optim.nonlinear.vector

Examples of org.apache.commons.math3.optim.nonlinear.vector.Weight


    @Test(expected=MathUnsupportedOperationException.class)
    public void testConstraintsUnsupported() {
        createOptimizer().optimize(new MaxEval(100),
                                   new Target(new double[] { 2 }),
                                   new Weight(new double[] { 1 }),
                                   new InitialGuess(new double[] { 1, 2 }),
                                   new SimpleBounds(new double[] { -10, 0 },
                                                    new double[] { 20, 30 }));
    }
View Full Code Here


        optimizer.optimize(new MaxEval(100),
                           circle.getModelFunction(),
                           circle.getModelFunctionJacobian(),
                           new Target(new double[] { 0, 0, 0, 0, 0 }),
                           new Weight(new double[] { 1, 1, 1, 1, 1 }),
                           new InitialGuess(new double[] { 98.680, 47.345 }));
    }
View Full Code Here

            PointVectorValuePair optimum
                = optimizer.optimize(new MaxEval(400 * (function.getN() + 1)),
                                     function.getModelFunction(),
                                     function.getModelFunctionJacobian(),
                                     new Target(function.getTarget()),
                                     new Weight(function.getWeight()),
                                     new InitialGuess(function.getStartPoint()));
            Assert.assertFalse(exceptionExpected);
            function.checkTheoreticalMinCost(optimizer.getRMS());
            function.checkTheoreticalMinParams(optimum);
        } catch (TooManyEvaluationsException e) {
View Full Code Here

        optimizer.optimize(new MaxEval(1),
                           problem.getModelFunction(),
                           problem.getModelFunctionJacobian(),
                           new Target(y),
                           new Weight(w),
                           new InitialGuess(a));
        final double expected = dataset.getResidualSumOfSquares();
        final double actual = optimizer.getChiSquare();
        Assert.assertEquals(dataset.getName(), expected, actual,
                            1E-11 * expected);
 
View Full Code Here

        optimizer.optimize(new MaxEval(1),
                           problem.getModelFunction(),
                           problem.getModelFunctionJacobian(),
                           new Target(y),
                           new Weight(w),
                           new InitialGuess(a));

        final double expected = FastMath
            .sqrt(dataset.getResidualSumOfSquares() /
                  dataset.getNumObservations());
View Full Code Here

        final PointVectorValuePair optimum
            = optimizer.optimize(new MaxEval(1),
                                 problem.getModelFunction(),
                                 problem.getModelFunctionJacobian(),
                                 new Target(y),
                                 new Weight(w),
                                 new InitialGuess(a));

        final double[] sig = optimizer.computeSigma(optimum.getPoint(), 1e-14);

        final int dof = y.length - a.length;
View Full Code Here

    @Test
    public void testGetIterations() {
        AbstractLeastSquaresOptimizer optim = createOptimizer();
        optim.optimize(new MaxEval(100), new Target(new double[] { 1 }),
                       new Weight(new double[] { 1 }),
                       new InitialGuess(new double[] { 3 }),
                       new ModelFunction(new MultivariateVectorFunction() {
                               public double[] value(double[] point) {
                                   return new double[] {
                                       FastMath.pow(point[0], 4)
View Full Code Here

        PointVectorValuePair optimum =
            optimizer.optimize(new MaxEval(100),
                               problem.getModelFunction(),
                               problem.getModelFunctionJacobian(),
                               problem.getTarget(),
                               new Weight(new double[] { 1 }),
                               new InitialGuess(new double[] { 0 }));
        Assert.assertEquals(0, optimizer.getRMS(), 1e-10);
        Assert.assertEquals(1.5, optimum.getPoint()[0], 1e-10);
        Assert.assertEquals(3.0, optimum.getValue()[0], 1e-10);
    }
View Full Code Here

        PointVectorValuePair optimum =
            optimizer.optimize(new MaxEval(100),
                               problem.getModelFunction(),
                               problem.getModelFunctionJacobian(),
                               problem.getTarget(),
                               new Weight(new double[] { 1, 1, 1 }),
                               new InitialGuess(new double[] { 0, 0 }));
        Assert.assertEquals(0, optimizer.getRMS(), 1e-10);
        Assert.assertEquals(7, optimum.getPoint()[0], 1e-10);
        Assert.assertEquals(3, optimum.getPoint()[1], 1e-10);
        Assert.assertEquals(4, optimum.getValue()[0], 1e-10);
View Full Code Here

        PointVectorValuePair optimum =
            optimizer.optimize(new MaxEval(100),
                               problem.getModelFunction(),
                               problem.getModelFunctionJacobian(),
                               problem.getTarget(),
                               new Weight(new double[] { 1, 1, 1, 1, 1, 1 }),
                               new InitialGuess(new double[] { 0, 0, 0, 0, 0, 0 }));
        Assert.assertEquals(0, optimizer.getRMS(), 1e-10);
        for (int i = 0; i < problem.target.length; ++i) {
            Assert.assertEquals(0.55 * i, optimum.getPoint()[i], 1e-10);
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.optim.nonlinear.vector.Weight

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.