Skip to content

"optim" and "nlminb"

3 messages · John C Nash, Spencer Graves, nserdar

#
It appears you are using the approach "throw every method at a problem and select the
answer you like". I use this quite a lot with optimx to see just what disasters I can
create, but I do so to see if the software will return sensible error messages.

You will have to provide a reproducible example if you want useful answers from this list
(as per posting guide). Optimization tools are like F1 racing cars -- many controls and
settings, with lots of power but difficulties in controlling it. Their users -- even if
well-qualified in other areas -- are unfortunately often those who have trouble riding a
bicycle with just one speed. There is a serious and quite involved learning curve.

Previously you tried optimx, but seem to have misunderstood or disregarded the answers. It
is quite likely the problem you are sending to the optimizers is ill-posed or plain wrong.
Certainly it does not have a gradient function, which is almost always a good idea. If you
prepare a reproducible example that can be run by readers of the list you will
  a) discover what is wrong as you prepare it, or
  b) be able to submit and very likely get useful help.

Indeed in several years on the list, I've never seen a query with a short, testable case
fail to get an answer very quickly.

JN
On 10/11/2012 06:00 AM, r-help-request at r-project.org wrote:
#
a fortune?
On 10/11/2012 9:56 AM, John C Nash wrote:
<snip>

  
    
#
I have already try "optimx" but I got this error message. How to solve it.

fn is  Linn 
Function has  10  arguments
par[ 1 ]:  0   <? 0.5   <? 1     In Bounds           
par[ 2 ]:  0   <? 0.5   <? 1     In Bounds   In Bounds          
par[ 3 ]:  0   <? 0.5   <? 1     In Bounds   In Bounds   In Bounds         
par[ 4 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds        
par[ 5 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds   In Bounds       
par[ 6 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds   In Bounds   In Bounds      
par[ 7 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds   In Bounds   In Bounds   In Bounds     
par[ 8 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds   In Bounds   In Bounds   In Bounds   In Bounds    
par[ 9 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds   In Bounds   In Bounds   In Bounds   In Bounds   In Bounds   
par[ 10 ]:  -Inf   <? 1   <? Inf     In Bounds   In Bounds   In Bounds   In
Bounds   In Bounds   In Bounds   In Bounds   In Bounds   In Bounds   In
Bounds  
Error in optimx(init.par, Linn, gr = NULL, method = "L-BFGS-B", hessian =
TRUE,  : 
  Function provided is not returning a scalar number

Regards,
Serdar



--
View this message in context: http://r.789695.n4.nabble.com/optim-and-nlminb-tp4645772p4645907.html
Sent from the R help mailing list archive at Nabble.com.