Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1C01770BF for ; Thu, 25 Aug 2011 09:29:00 +0000 (UTC) Received: (qmail 48530 invoked by uid 500); 25 Aug 2011 09:28:58 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 48066 invoked by uid 500); 25 Aug 2011 09:28:40 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 48053 invoked by uid 99); 25 Aug 2011 09:28:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2011 09:28:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2011 09:28:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D234B23889F7 for ; Thu, 25 Aug 2011 09:28:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1161463 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java Date: Thu, 25 Aug 2011 09:28:13 -0000 To: commits@commons.apache.org From: erans@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110825092813.D234B23889F7@eris.apache.org> Author: erans Date: Thu Aug 25 09:28:13 2011 New Revision: 1161463 URL: http://svn.apache.org/viewvc?rev=1161463&view=rev Log: MATH-413 New constructor. Javadoc typos. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java?rev=1161463&r1=1161462&r2=1161463&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java Thu Aug 25 09:28:13 2011 @@ -141,11 +141,11 @@ public class LevenbergMarquardtOptimizer * other contructor}. * The default values for the algorithm settings are: *
    - *
  • Initial step bound factor}: 100
  • - *
  • Cost relative tolerance}: 1e-10
  • - *
  • Parameters relative tolerance}: 1e-10
  • - *
  • Orthogonality tolerance}: 1e-10
  • - *
  • QR ranking threshold}: {@link MathUtils#SAFE_MIN}
  • + *
  • Initial step bound factor: 100
  • + *
  • Cost relative tolerance: 1e-10
  • + *
  • Parameters relative tolerance: 1e-10
  • + *
  • Orthogonality tolerance: 1e-10
  • + *
  • QR ranking threshold: {@link MathUtils#SAFE_MIN}
  • *
*/ public LevenbergMarquardtOptimizer() { @@ -153,6 +153,61 @@ public class LevenbergMarquardtOptimizer } /** + * Constructor that allows the specification of a custom convergence + * checker. + * Note that all the usual convergence checks will be disabled. + * The default values for the algorithm settings are: + *
    + *
  • Initial step bound factor: 100
  • + *
  • Cost relative tolerance: 1e-10
  • + *
  • Parameters relative tolerance: 1e-10
  • + *
  • Orthogonality tolerance: 1e-10
  • + *
  • QR ranking threshold: {@link MathUtils#SAFE_MIN}
  • + *
+ * + * @param checker Convergence checker. + */ + public LevenbergMarquardtOptimizer(ConvergenceChecker checker) { + this(100, checker, 1e-10, 1e-10, 1e-10, MathUtils.SAFE_MIN); + } + + /** + * Constructor that allows the specification of a custom convergence + * checker, in addition to the standard ones. + * + * @param initialStepBoundFactor Positive input variable used in + * determining the initial step bound. This bound is set to the + * product of initialStepBoundFactor and the euclidean norm of + * {@code diag * x} if non-zero, or else to {@code initialStepBoundFactor} + * itself. In most cases factor should lie in the interval + * {@code (0.1, 100.0)}. {@code 100} is a generally recommended value. + * @param checker Convergence checker. + * @param costRelativeTolerance Desired relative error in the sum of + * squares. + * @param parRelativeTolerance Desired relative error in the approximate + * solution parameters. + * @param orthoTolerance Desired max cosine on the orthogonality between + * the function vector and the columns of the Jacobian. + * @param threshold Desired threshold for QR ranking. If the squared norm + * of a column vector is smaller or equal to this threshold during QR + * decomposition, it is considered to be a zero vector and hence the rank + * of the matrix is reduced. + */ + public LevenbergMarquardtOptimizer(double initialStepBoundFactor, + ConvergenceChecker checker, + double costRelativeTolerance, + double parRelativeTolerance, + double orthoTolerance, + double threshold) { + super(checker); + this.initialStepBoundFactor = initialStepBoundFactor; + this.costRelativeTolerance = costRelativeTolerance; + this.parRelativeTolerance = parRelativeTolerance; + this.orthoTolerance = orthoTolerance; + this.qrRankingThreshold = threshold; + } + + /** * Build an optimizer for least squares problems with default values * for some of the tuning parameters (see the {@link * #LevenbergMarquardtOptimizer(double,double,double,double,double)