This function implements the simulated annealing algorithm, which is a global optimization algorithm that is useful for finding a good starting point for a local optimization algorithm. We do not return this as an MLE object because, to be a good estimate of the MLE, the gradient of `f` evaluated at its solution should be close to zero, assuming the MLE is interior to the domain of `f`. However, since this algorithm is not guided by gradient information, it is not sensitive to the gradient of `f` and instead only seeks to maximize `f`.
Usage
sim_anneal(x0 = NULL, obj_fn = NULL, options = list(), ...)Arguments
- x0
Initial guess, default is NULL (must be specified in options)
- obj_fn
Objective function to maximize, default is NULL (must be specified in options)
- options
List of optional arguments
- ...
Additional arguments that may be passed to `options$neigh`
Value
list with best solution (argmax) and its corresponding objective function value (max), and optionally path
Fields
t_initInitial temperature
t_endFinal temperature
alphaCooling factor
iter_per_tempNumber of iterations per temperature
max_iterMaximum number of iterations, used instead of t_end if not NULL, defaults to NULL
debugIf TRUE, print debugging information to the console
traceIf TRUE, track the history of positions and values
supSupport function, returns TRUE if x is in the domain of f
neighNeighborhood function, returns a random neighbor of x
debug_freqFrequency of debug output, defaults to 10
obj_fnObjective function to maximize, if not specified in formal parameter `obj_fn`
x0Initial guess, if not specified in formal parameter `x0`