Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7E8794E2 for ; Tue, 20 Dec 2011 03:23:55 +0000 (UTC) Received: (qmail 69109 invoked by uid 500); 20 Dec 2011 03:23:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69046 invoked by uid 500); 20 Dec 2011 03:23:55 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69037 invoked by uid 99); 20 Dec 2011 03:23:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2011 03:23:54 +0000 X-ASF-Spam-Status: No, hits=-2002.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2011 03:23:53 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 73A9811C77D for ; Tue, 20 Dec 2011 03:23:32 +0000 (UTC) Date: Tue, 20 Dec 2011 03:23:32 +0000 (UTC) From: "Bruce A Johnson (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <744973084.29377.1324351412506.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <273411527.29210.1324346733314.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-728) Errors in BOBYQAOptimizer when numberOfInterpolationPoints is greater than 2*dim+1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172888#comment-13172888 ] Bruce A Johnson commented on MATH-728: -------------------------------------- Making this change fixes the problem and seems reasonable, but one of the original translators (from FORTRAN to Java) should look this section of code over. @@ -1657,10 +1657,10 @@ final int tmp2 = jpt; jpt = ipt - n; ipt = tmp2; - throw new PathIsExploredException(); // XXX + //throw new PathIsExploredException(); // XXX } - interpolationPoints.setEntry(nfm, ipt, interpolationPoints.getEntry(ipt, ipt)); - interpolationPoints.setEntry(nfm, jpt, interpolationPoints.getEntry(jpt, jpt)); + interpolationPoints.setEntry(nfm, ipt-1, interpolationPoints.getEntry(ipt, ipt-1)); + interpolationPoints.setEntry(nfm, jpt-1, interpolationPoints.getEntry(jpt, jpt-1)); > Errors in BOBYQAOptimizer when numberOfInterpolationPoints is greater than 2*dim+1 > ---------------------------------------------------------------------------------- > > Key: MATH-728 > URL: https://issues.apache.org/jira/browse/MATH-728 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.0 > Environment: Mac Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527) > Reporter: Bruce A Johnson > > I've been having trouble getting BOBYQA to minimize a function (actually a non-linear least squares fit) so as one change I increased the number of interpolation points. It seems that anything larger than 2*dim+1 causes an error (typically at > line 1662 > interpolationPoints.setEntry(nfm, ipt, interpolationPoints.getEntry(ipt, ipt)); > I'm guessing there is an off by one error in the translation from FORTRAN. Changing the BOBYQAOptimizerTest as follows (increasing number of interpolation points by one) will cause failures. > Bruce > Index: src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java > =================================================================== > --- src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java (revision 1221065) > +++ src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java (working copy) > @@ -258,7 +258,7 @@ > // RealPointValuePair result = optim.optimize(100000, func, goal, startPoint); > final double[] lB = boundaries == null ? null : boundaries[0]; > final double[] uB = boundaries == null ? null : boundaries[1]; > - BOBYQAOptimizer optim = new BOBYQAOptimizer(2 * dim + 1); > + BOBYQAOptimizer optim = new BOBYQAOptimizer(2 * dim + 2); > RealPointValuePair result = optim.optimize(maxEvaluations, func, goal, startPoint, lB, uB); > // System.out.println(func.getClass().getName() + " = " > // + optim.getEvaluations() + " f("); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira