|
Commons Math example source code file (GaussNewtonEstimator.java)
The Commons Math GaussNewtonEstimator.java source code/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.math.estimation; import java.io.Serializable; import org.apache.commons.math.linear.InvalidMatrixException; import org.apache.commons.math.linear.LUDecompositionImpl; import org.apache.commons.math.linear.MatrixUtils; import org.apache.commons.math.linear.RealMatrix; import org.apache.commons.math.linear.RealVector; import org.apache.commons.math.linear.ArrayRealVector; /** * This class implements a solver for estimation problems. * * <p>This class solves estimation problems using a weighted least * squares criterion on the measurement residuals. It uses a * Gauss-Newton algorithm.</p> * * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $ * @since 1.2 * @deprecated as of 2.0, everything in package org.apache.commons.math.estimation has * been deprecated and replaced by package org.apache.commons.math.optimization.general * */ @Deprecated public class GaussNewtonEstimator extends AbstractEstimator implements Serializable { /** Serializable version identifier */ private static final long serialVersionUID = 5485001826076289109L; /** Default threshold for cost steady state detection. */ private static final double DEFAULT_STEADY_STATE_THRESHOLD = 1.0e-6; /** Default threshold for cost convergence. */ private static final double DEFAULT_CONVERGENCE = 1.0e-6; /** Threshold for cost steady state detection. */ private double steadyStateThreshold; /** Threshold for cost convergence. */ private double convergence; /** Simple constructor with default settings. * <p> * The estimator is built with default values for all settings. * </p> * @see #DEFAULT_STEADY_STATE_THRESHOLD * @see #DEFAULT_CONVERGENCE * @see AbstractEstimator#DEFAULT_MAX_COST_EVALUATIONS */ public GaussNewtonEstimator() { this.steadyStateThreshold = DEFAULT_STEADY_STATE_THRESHOLD; this.convergence = DEFAULT_CONVERGENCE; } /** * Simple constructor. * * <p>This constructor builds an estimator and stores its convergence * characteristics.</p> * * <p>An estimator is considered to have converged whenever either * the criterion goes below a physical threshold under which * improvements are considered useless or when the algorithm is * unable to improve it (even if it is still high). The first * condition that is met stops the iterations.</p> * * <p>The fact an estimator has converged does not mean that the * model accurately fits the measurements. It only means no better * solution can be found, it does not mean this one is good. Such an * analysis is left to the caller.</p> * * <p>If neither conditions are fulfilled before a given number of * iterations, the algorithm is considered to have failed and an * {@link EstimationException} is thrown.</p> * * @param maxCostEval maximal number of cost evaluations allowed * @param convergence criterion threshold below which we do not need * to improve the criterion anymore * @param steadyStateThreshold steady state detection threshold, the * problem has converged has reached a steady state if * <code>Math.abs(Jn - Jn-1) < * J<sub>n × convergence, where Other Commons Math examples (source code examples)Here is a short list of links related to this Commons Math GaussNewtonEstimator.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.