Re: [R] optimization problem

From: John C Nash <>
Date: Fri, 28 Nov 2008 11:28:29 -0500

tedzxx asked about apparent multiple optima. See below.

Users should be aware that optim() does local optimization. The default Nelder-Mead approach is fairly robust at finding such a local minimum, though it may halt if it is on a flat area of the loss function surface. I would recommend trying one of the BFGS codes (they use somewhat different approaches) and look at the gradient information. With only 3 parameters, these should work fine. There is also another package (I forget the name -- someone?) that does full Newton with Hessian computed. That may be worth using to get more complete information about your problem.

tedzxx: If you send me the data off-list (maybe also include the function again to save me digging it up again), I'll try to provide more information.

John Nash

>Date: Thu, 27 Nov 2008 23:30:56 -0800 (PST)
>From: tedzzx <>
>Subject: [R] optimization problem
>Message-ID: <>
>Content-Type: text/plain; charset=UTF-8

  I am facing an optimization problem. I am using the function optim(par,fun),   but I find that every time I give different original guess parameter, I can   get different result. For example
  I have a data frame named data:

     price s x t

  1 1678.0 12817 11200 0.1495902
  2 1675.5 12817 11200 0.1495902
  3 1678.0 12817 11200 0.1495902
  4 1688.0 12817 11200 0.1495902
  5 1677.0 12817 11200 0.1495902
  6 1678.5 12817 11200 0.1495902

  optim(par=p,f) # use the default algorism

  I have other different original estimes, It also show me different result.


Thanks. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 28 Nov 2008 - 16:31:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 28 Nov 2008 - 17:30:29 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive