Description Usage Arguments Details Value See Also Examples
Use hill climbing to find the global minimum
1 | hillclimbing(f, x, h = 1, m = 1000)
|
f |
function representing the derivative of |
x |
an initial estimate of the minimum |
h |
the step size |
m |
the maximum number of iterations |
Hill climbing
the x
value of the minimum found
Other optimz:
bisection()
,
goldsect
,
gradient
,
newton()
,
sa()
,
secant()
1 2 3 4 5 6 | f <- function(x) {
(x[1]^2 + x[2] - 11)^2 + (x[1] + x[2]^2 - 7)^2
}
hillclimbing(f, c(0,0))
hillclimbing(f, c(-1,-1))
hillclimbing(f, c(10,10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.