SequentialLineMin {scdensity}R Documentation

Minimize a function of r variables by sequential univariate searches.

Description

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.

Usage

SequentialLineMin(fcn, bounds, v0, tol = .Machine$double.eps^0.25)

Arguments

fcn

A function with taking an r-vector as its first argument: call as fcn(v,...).

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 optimize.

Details

This algorithm is designed to search for solutions of the form v = [v_1 v_2 \ldots 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.

Value

a list with elements:

minimizer

An r-vector containing the solution.

minimum

The objective function value at the solution.

Examples

fcn <- function(v) (v[1]+1)^2 + (v[2]-1)^2
SequentialLineMin(fcn, c(-5,5), c(-3,3))


[Package scdensity version 1.0.2 Index]