Local-Search Information
The function can be called from the objective and neighbourhood
function during a run of LSopt
; it provides information
such as the current iteration.
LS.info(n = 0L)
n |
generational offset; see Details. |
This function is still experimental.
The function can be called in the neighbourhood function or the
objective function during a run of LSopt
. It evaluates
to a list with the state of the optimisation run, such as the current
iteration.
LS.info
relies on parent.frame
to retrieve its
information. If the function is called within another function in the
neighbourhood or objective function, the argument n
needs to be
increased.
A list
iteration |
current iteration |
step |
same as ‘iteration’ |
Enrico Schumann
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. https://www.elsevier.com/books/numerical-methods-and-optimization-in-finance/gilli/978-0-12-815065-8
Schumann, E. (2019) Financial Optimisation with R (NMOF Manual). http://enricoschumann.net/NMOF.htm#NMOFmanual
## MINIMAL EXAMPLE for LSopt ## objective function evaluates to a constant fun <- function(x) 0 ## neighbourhood function does not even change the solution, ## but it reports information nb <- function(x) { tmp <- LS.info() cat("current iteration ", tmp$iteration, "\n") x } ## run LS algo <- list(nS = 5, x0 = rep(0, 5), neighbour = nb, printBar = FALSE) ignore <- LSopt(fun, algo)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.