"Numerical optimisations are best done using as many methods as possible"
See the "optimx" package: http://cran.r-project.org/web/packages/optimx/index.html Ravi. -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Barry Rowlingson Sent: Wednesday, September 08, 2010 10:27 AM To: Michael Bernsteiner Cc: r-help@r-project.org Subject: Re: [R] optimized value worse than starting Value On Wed, Sep 8, 2010 at 1:35 PM, Michael Bernsteiner <dethl...@hotmail.com> wrote: > > Dear all, > > I'm optimizing a relatively simple function. Using optimize the optimized parameter value is worse than the starting. > why? > > f<-function(delta,P,U){ > minimiz<-P+delta*U > x<-minimiz[1] > y<-minimiz[2] > z<-100*(y-x^2)^2+(1-x)^2 > return(z) > } This looks familiar. Is this some 1-d version of the Rosenbrock Banana Function? http://en.wikipedia.org/wiki/Rosenbrock_function It's designed to be hard to find the minimum. In the real world one would hope that things would not have such a pathological behaviour. Numerical optimisations are best done using as many methods as possible - see optimise, nlm, optim, nlminb and the whole shelf of library books devoted to it. Barry ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.