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

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


        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

            final PointVectorValuePair optimum
                = optim.optimize(new MaxEval(Integer.MAX_VALUE),
                                 problem.getModelFunction(),
                                 problem.getModelFunctionJacobian(),
                                 new Target(problem.target()),
                                 new Weight(problem.weight()),
                                 new InitialGuess(init));
            final double[] sigma = optim.computeSigma(optimum.getPoint(), 1e-14);

            // Accumulate statistics.
            for (int i = 0; i < numParams; i++) {
View Full Code Here

        optim.optimize(new MaxEval(Integer.MAX_VALUE),
                       problem.getModelFunction(),
                       problem.getModelFunctionJacobian(),
                       new Target(t),
                       new Weight(w),
                       new InitialGuess(params));

        return optim.getChiSquare() / (t.length - params.length);
    }
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

        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, 0 }));
        Assert.assertEquals(0, optimizer.getRMS(), 1e-10);
        Assert.assertEquals(1, optimum.getPoint()[0], 1e-10);
        Assert.assertEquals(2, optimum.getPoint()[1], 1e-10);
        Assert.assertEquals(3, optimum.getPoint()[2], 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);
        Assert.assertEquals(3, optimum.getPoint()[0], 1e-10);
        Assert.assertEquals(4, optimum.getPoint()[1], 1e-10);
        Assert.assertEquals(-1, optimum.getPoint()[2], 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.