[sorry, forgot some details...] I'm using optim(param, fun, method='L-BFGS-B', lower=lo, upper=up) to minimize a certain function. Often the minimization ends with the message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH What is optim() trying to say? What have I to change in my function to make the minimization succeed? Do you think using BBoptim() instead of optim() changes anything? Thanks for your help! mario -- Ing. Mario Valle Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
You forgot a lot of details. Can you send us more information about the "fn" and also some minimal code that can reproduce the problem? Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: rvaradhan at jhmi.edu Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty_personal_pages/Varadhan.h tml ---------------------------------------------------------------------------- -------- -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Mario Valle Sent: Tuesday, January 12, 2010 11:53 AM To: R-help at r-project.org Subject: [R] optim: abnormal termination in lnsrch (resend) [sorry, forgot some details...] I'm using optim(param, fun, method='L-BFGS-B', lower=lo, upper=up) to minimize a certain function. Often the minimization ends with the message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH What is optim() trying to say? What have I to change in my function to make the minimization succeed? Do you think using BBoptim() instead of optim() changes anything? Thanks for your help! mario -- Ing. Mario Valle Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 ______________________________________________ R-help at 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.
Attached a script that reproduces the problem. My function is fold.val() and at the end seems the curve contained in lnsrch.dat is fitted quite well, but optim generates the error. Thanks again! mario ------------------------- I'm using optim(param, fun, method='L-BFGS-B', lower=lo, upper=up) to minimize a certain function. Often the minimization ends with the message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH What is optim() trying to say? What have I to change in my function to make the minimization succeed? Do you think using BBoptim() instead of optim() changes anything? Thanks for your help! mario -- Ing. Mario Valle Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: lnsrch.r URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100112/a6951a66/attachment.pl> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: lnsrch.dat URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100112/a6951a66/attachment-0001.pl>
Mario Valle wrote:> > [sorry, forgot some details...] > > I'm using optim(param, fun, method='L-BFGS-B', lower=lo, upper=up) to > minimize a certain function. > Often the minimization ends with the message: > ERROR: ABNORMAL_TERMINATION_IN_LNSRCH > > What is optim() trying to say? > What have I to change in my function to make the minimization succeed? > Do you think using BBoptim() instead of optim() changes anything? >We need more information. You can also try the additional argument to optim for tracing the optimization. Use optim(param, fun, method='L-BFGS-B', lower=lo, upper=up ,control=list(trace=6)) to get more information. Berend -- View this message in context: http://n4.nabble.com/optim-abnormal-termination-in-lnsrch-resend-tp1012255p1012370.html Sent from the R help mailing list archive at Nabble.com.