[R] Question about nlminb function

Lim, Hwanggyu h||m @end|ng |rom gm@c@com
Tue Apr 7 21:34:20 CEST 2020

Hello Ivan,

Thank you so much for your valuable comments. I will definitely look at the R package of nloptr you introduced.


-----Original Message-----
From: Ivan Krylov <krylov.r00t using gmail.com>
Sent: Friday, April 3, 2020 5:25 AM
To: Lim, Hwanggyu <hlim using gmac.com>
Cc: r-help using r-project.org
Subject: Re: [R] Question about nlminb function

On Thu, 2 Apr 2020 10:26:07 +0000
"Lim, Hwanggyu" <hlim using gmac.com> wrote:

> when n-1th estimates and nth estimates have absolute differences less
> than 0.001 for all three parameters, the iteration must stop

> I am using nlminb optimization function

nlminb function uses the PORT library. According to [1], the closest thing PORT has to what you want is the notion of X-convergence, namely, stopping when max(scale * abs(x - xstar))/max(scale * abs(x + xstar)) is considered to be below control$x.tol (with xstar being supposed local minimiser and scale being all ones by default). Using it as an absolute stopping criterion in x requires knowledge of at least order of magnitude of xstar, though, so it might not be feasible.

Note that ?nlminb says in the description that it is there "for historical compatibility."

The nloptr package offers an xtol_abs option [2] that results in the behaviour you want.

Best regards,

[1] David M. Gay, Usage Summary for Selected Optimization Routines.

The information in this transmission is confidential and intended only for the recipient listed above. If you are not the intended recipient, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. If you are not the intended recipient, you are hereby notified that any disclosure, copying or distribution of this message, or the taking of any action based upon it, is strictly prohibited.

More information about the R-help mailing list