[R] optim evils

William Dunlap wdunlap at tibco.com
Wed Sep 4 18:24:09 CEST 2013


> This is not efficient.

For whom?

> (a) L-BFGS-B does not identify itself even though it was called overriding the method
> parameter in optim.

Would you prefer that the warning 
  > o <- optim(par=c(1,2), fn=function(x)-sum(abs(sin(x))), method="CG", lower=c(-1,-1), upper= c(2,3))
  Warning message:
  In optim(par = c(1, 2), fn = function(x) -sum(abs(sin(x))), method = "CG",  :
    bounds can only be used with method L-BFGS-B (or Brent)
explicitly say that method L-BFGS-B was used because bounds were given?

> (b) Optim  reports as final converged minimum value a function value that is much larger
> than others computed during the optimization.

That is where a self-contained example would make it much quicker to identify and perhaps fix the problem.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of Michael Meyer
> Sent: Wednesday, September 04, 2013 1:35 AM
> To: r-help at r-project.org
> Subject: [R] optim evils
> 
> It would take some effort to extract selfcontained code from the mass of code wherein
> this optimization is embedded. Moreover I would have to obtain permission from my
> employer to do so.
> 
> This is not efficient.
> However some things are evident from the trace log which I have submitted:
> (a) L-BFGS-B does not identify itself even though it was called overriding the method
> parameter in optim.
> (b) Optim  reports as final converged minimum value a function value that is much larger
> than
> others computed during the optimization.
> 
> I think we can agree on calling this a bug.
> 	[[alternative HTML version deleted]]



More information about the R-help mailing list