optim.stop | R Documentation |
Title optim wrapper for early stopping criterion
optim.stop(
par,
fn,
gr = NULL,
fn.stop = NA,
fn.NaN = NaN,
control = list(),
...
)
par |
starting point for optim |
fn |
objective function, like in optim(). |
gr |
gradient function, like in optim(). |
fn.stop |
early stopping criterion |
fn.NaN |
replacement value of fn when returns NaN |
control |
control parameters for optim() |
... |
additional arguments passed to optim() |
list with best solution and all solutions
Yann Richet, IRSN
fn = function(x) x^6
o = optim( par=15, fn,lower=-20,upper=20,method='L-BFGS-B')
o.s = optim.stop( par=15, fn,lower=-20,upper=20,method='L-BFGS-B',fn.stop=0.1)
#check o.s$value == 0.1 && o.s$counts < o$counts
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.