[R] Stopping precision using 'optim'

Ravi Varadhan rvaradhan at jhmi.edu
Fri Aug 6 18:30:41 CEST 2010


Read the help file for optim().

?optim

It clearly says the following with regards to L-BFGS-B:

factr
controls the convergence of the "L-BFGS-B" method. Convergence occurs when
the reduction in the objective is within this factor of the machine
tolerance. Default is 1e7, that is a tolerance of about 1e-8. 

pgtol
helps control the convergence of the "L-BFGS-B" method. It is a tolerance on
the projected gradient in the current search direction. This defaults to
zero, when the check is suppressed.

So, all you need to do is to change these two (I am not sure if you really
want to change pgtol) if you want better (or different) answers.  

You should not *minimize* the log-likelihood.  You may have meant that you
are minimizing its negative.  You can do this by setting control$fnscale =
-1.

Hope this helps,
Ravi.

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Jeremy Beaulieu
Sent: Thursday, August 05, 2010 8:45 PM
To: r-help at r-project.org
Subject: [R] Stopping precision using 'optim'

Hi all~

I am wondering if it is possible to alter the stopping precision for
parameters estimated using the 'optim'?

If it helps, I am minimizing the log-likelihood of a function using
constraints (i.e. L-BFG-S). 

-Jeremy
______________________________________________
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.



More information about the R-help mailing list