[ 
https://issues.apache.org/jira/browse/MATH-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206281#comment-13206281
 ] 

Bruce A Johnson commented on MATH-728:
--------------------------------------

I've been playing with BOBYQA (downloaded from svn repository today, and 
commenting out the PathNotExplored exceptions).  A couple observations.
1) I can't make it fail with large number of interpolation points (as long as 
you stay under the (2n+1)*(2n+2)/2 recommended max. So this issue is resolved.
2) With large number of interpolation points the algorithm is significantly 
slower.  I'm minimizing a function  with a 169 parameters.  The function 
evaluation takes ~50 msec.  With n+2 interpolation points, the additional time 
for each step is about 10 msec.  With 2*n+1 points, the additional time is 
about 50 msec, and with about 6*n, the additional time is 250 msec.  So with 
larger nInterpolation points a lot of time is spent in the algorithm, besides 
evaluating the function.   At some point I'll try to do some profiling of the 
code.
3) It makes a big difference to normalize the parameters as the initial search 
region is dependent on the point with the smallest boundary difference.  So it 
seems one shouldn't directly fit the "natural" parameters but normalized values.
                
> 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

        

Reply via email to