[R] optimization problem
John C Nash
nashjc at uottawa.ca
Fri Nov 28 17:28:29 CET 2008
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.
>Date: Thu, 27 Nov 2008 23:30:56 -0800 (PST)
>From: tedzzx <zengzhenxing at gmail.com>
>Subject: [R] optimization problem
>To: r-help at r-project.org
>Message-ID: <20730032.post at talk.nabble.com>
>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.
More information about the R-help