Description Usage Arguments Details Value Examples
The function seeks to minimize fcn
, a scalar function of r variables. v0
is a starting solution and bounds
is a 2-vector giving upper and lower limits for
elements of the solution.
1 | SequentialLineMin(fcn, bounds, v0, tol = .Machine$double.eps^0.25)
|
fcn |
A function with taking an r-vector as its first argument: call as |
bounds |
A 2-vector giving the upper and lower limits for elements of a solution. |
v0 |
A starting solution, with increasing elements. An r-vector. Not used if r == 1. |
tol |
Tolerance passed to |
This algorithm is designed to search for solutions of the form v = [v_1 v_2 … v_r],
where bounds(1)
< v_1 < v_2 < ... < v_r < bounds(2)
. It loops through the solution vector
one variable at a time, and does a 1-D line search using optimize()
for an improving
value of that variable. So when optimizing v_i, it searches the interval (v_{i-1},
v_{i+1}) to maintain the increasing nature of v. The overall search terminates once a
pass through all r elements of v fails to produce any changes to v.
a list with elements:
|
An r-vector containing the solution. |
|
The objective function value at the solution. |
1 2 | fcn <- function(v) (v[1]+1)^2 + (v[2]-1)^2
SequentialLineMin(fcn, c(-5,5), c(-3,3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.