goldsect: Golden Section Search

Description Usage Arguments Details Value See Also Examples

Description

Use golden section search to find local extrema

Usage

1
2
3
goldsectmin(f, a, b, tol = 0.001, m = 100)

goldsectmax(f, a, b, tol = 0.001, m = 100)

Arguments

f

function to integrate

a

the a bound of the search region

b

the b bound of the search region

tol

the error tolerance

m

the maximum number of iterations

Details

The golden section search method functions by repeatedly dividing the interval between a and b and will return when the interval between them is less than tol, the error tolerance. However, this implementation also stop if after m iterations.

Value

the x value of the minimum found

See Also

Other optimz: bisection, gradient, hillclimbing, newton, sa, secant

Examples

1
2
f <- function(x) { x^2 - 3 * x + 3 }
goldsectmin(f, 0, 5)


Search within the cmna package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.