sa {cmna} | R Documentation |
Simulated annealing
Description
Use simulated annealing to find the global minimum
Usage
sa(f, x, temp = 10000, rate = 1e-04)
tspsa(x, temp = 100, rate = 1e-04)
Arguments
f |
function representing |
x |
an initial estimate of the minimum |
temp |
the initial temperature |
rate |
the cooling rate |
Details
Simulated annealing finds a global minimum by mimicing the metallurgical process of annealing.
Value
the x
value of the minimum found
See Also
Other optimz:
bisection()
,
goldsect
,
gradient
,
hillclimbing()
,
newton()
,
secant()
Examples
f <- function(x) { x^6 - 4 * x^5 - 7 * x^4 + 22 * x^3 + 24 * x^2 + 2}
sa(f, 0)
f <- function(x) { (x[1] - 1)^2 + (x[2] - 1)^2 }
sa(f, c(0, 0), 0.05)
[Package cmna version 1.0.5 Index]