[
https://issues.apache.org/jira/browse/MATH-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173259#comment-13173259
]
Gilles commented on MATH-728:
-----------------------------
Anyone who wishes to use the "BOBYQAOptimizer" class should have a look at the
MATH-621 issue.
As you have figured out, the code is really not ready yet. Unfortunately, the
implementation being not "natural" in Java, it is not easy to separate
algorithm complexity from Fortran-driven optimizations (which should be
removed).
The problem is all compounded by the fall-through switch-cases which should
also be recoded properly.
We are still in the middle of the river: Many things have been improved
structure-wise but bugs could have crept in while doing so. Bugs like the one
you discovered.
And we don't have a thorough test suite to ensure that every code path works as
in the original Fortran.
The code was checked in under the assumption that it would be converted into
"natural" Java, so that people can maintain it.
I wonder whether it should not be removed for the upcoming release...
> 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