commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luca.marche...@univr.it
Subject Re: [math] Problem using the LevenbergMarquardtOptimizer
Date Sun, 03 Feb 2013 11:22:32 GMT
Dear Gilles,
thank you for the very complete answer. This finally solves the question I raised!
As a developer, I understand why you chose to maintain a simple API. 
Despite this, I agree with you that, at the moment, the situation is quite confusing. As you
suggested, a simple solution can be to update the javadoc page of each optimizer with few
lines that warns developers on which options are really functional and which ones will be
functional in future... This little update will be a big help for all those developers that
are not familiar with the Java library.
In addition to this, I suggest also to update the code for throwing an exception when the
optimizer is run with options that it cannot handle. I understand that this may led to other
problems... but I think that, especially when we need to solve very hard mathematical problems,
it is dangerous to not catch this situation. At the end, an optimizer that is run with a bound
option and that does not care about this, returns a solution that may be very distant from
the desired one...


Have a nice day,


Luca
  

----- Messaggio originale -----
Da: Gilles <gilles@harfang.homelinux.org>
Data: Saturday, February 2, 2013 12:24
Oggetto: Re: [math] Problem using the LevenbergMarquardtOptimizer
A: luca.marchetti@univr.it
Cc: user@commons.apache.org, dev@commons.apache.org

> Hello.
> 
> > Dear all,
> > I'm using the commons math library for solving least-squares 
> problems> using the LevenbergMarquardtOptimizer.
> > I have a problem when I specify bounds for the estimation (by means
> > of a SimpleBounds object). I don't understand why, but the estimate
> > seems to not care about the bounds.
> > I attach to the mail a simple code which gives the problem. 
> This code
> > is inspired to the one published on the web-site for 
> explaining how
> > the LevenbergMarquardtOptimizer works...
> > The code at the end perform two estimates:
> > 1) the first one without bounds is correct;
> > 2) the second one, instead, should take care of the bounds, 
> but I
> > obtain the same values as in the first case... :-(
> 
> Actually, the "LevenbergMarquardtOptimizer" does not support bounds,
> even though the API accepts that you pass them.
> In fact, all "options" can be passed to all optimizers but not all
> optimizers will use all of the options, if you see what I mean. 
> :-)
> 
> I agree that this is confusing. [The issue was already raised but
> perhaps you could file a report on the project's bug-tracking system
> so that we can gather all opinions on how to best deal with it.
> I chose the current behaviour because it allows a much simpler API.
> One way would be to just document which options are ignored by a
> given optimizer implementation (and that would leave room to add
> support later).]
> 
> Currently, only the "CMAESOptimizer" implementation supports bounds.
> However, Commons Math provides function wrappers which you can 
> use to
> approximate support for simple bounds:
>    
> http://commons.apache.org/math/apidocs/org/apache/commons/math3/optim/nonlinear/scalar/MultivariateFunctionMappingAdapter.html
>    
> http://commons.apache.org/math/apidocs/org/apache/commons/math3/optim/nonlinear/scalar/MultivariateFunctionPenaltyAdapter.html
> [But note the caveat indicated there (which might require that 
> you use
> a "custom" convergence checker).]
> 
> HTH,
> Gilles
> 
> 
> -----------------------------------------------------------------
> ----
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

---
Dr. Luca Marchetti, PhD
Research associate
Center for BioMedical Computing
University of Verona, Department of Computer Science
Strada Le Grazie 15, 37134 Verona, Italy
e-mail: luca.marchetti@univr.it




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message