Package org.apache.commons.math.optimization.fitting

Examples of org.apache.commons.math.optimization.fitting.CurveFitter


     * Constructs an instance using the specified optimizer.
     *
     * @param optimizer optimizer to use for the fitting
     */
    public GaussianFitter(DifferentiableMultivariateVectorialOptimizer optimizer) {
        fitter = new CurveFitter(optimizer);
    }
View Full Code Here


     * @throws FunctionEvaluationException in the event of a test case error
     */
    @Test
    public void testFit01()
    throws OptimizationException, FunctionEvaluationException {
        CurveFitter fitter = new CurveFitter(new LevenbergMarquardtOptimizer());
        addDatasetToCurveFitter(DATASET1, fitter);
        double[] parameters = fitter.fit(new ParametricGaussianFunction(),
                                         new double[] {8.64753e3, 3.483323e6, 4.06322, 1.946857e-2});
        assertEquals(99200.94715858076, parameters[0], 1e-4);
        assertEquals(3410515.221897707, parameters[1], 1e-4);
        assertEquals(4.054928275257894, parameters[2], 1e-4);
        assertEquals(0.014609868499860, parameters[3], 1e-4);
View Full Code Here

     * @throws FunctionEvaluationException in the event of a test case error
     */
    @Test
    public void testFit02()
    throws OptimizationException, FunctionEvaluationException {
        CurveFitter fitter = new CurveFitter(new LevenbergMarquardtOptimizer());
        addDatasetToCurveFitter(DATASET1, fitter);
        double[] parameters = fitter.fit(new ParametricGaussianFunction(),
                                         new double[] {500000.0, 3500000.0, 4.055, 0.025479654});
        assertEquals(99200.81836264656, parameters[0], 1e-4);
        assertEquals(3410515.327151986, parameters[1], 1e-4);
        assertEquals(4.054928275377392, parameters[2], 1e-4);
        assertEquals(0.014609869119806, parameters[3], 1e-4);
View Full Code Here

TOP

Related Classes of org.apache.commons.math.optimization.fitting.CurveFitter

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.