Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fibsearch

Fibonacci Search


Description

Fibonacci search for function minimum.

Usage

fibsearch(f, a, b, ..., endp = FALSE, tol = .Machine$double.eps^(1/2))

Arguments

f

Function or its name as a string.

a, b

endpoints of the interval

endp

logical; shall the endpoints be considered as possible minima?

tol

absolute tolerance; default eps^(1/2).

...

Additional arguments to be passed to f.

Details

Fibonacci search for a univariate function minimum in a bounded interval.

Value

Return a list with components xmin, fmin, the function value at the minimum, niter, the number of iterations done, and the estimated precision estim.prec

See Also

Examples

f <- function(x) x * cos(0.1*exp(x)) * sin(0.1*pi*exp(x))
fibsearch(f, 0, 4, tol=10^-10)   # $xmin    = 3.24848329403424
optimize(f, c(0,4), tol=10^-10)  # $minimum = 3.24848328971188

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.