Skip to main content

Module golden_section_search

Module golden_section_search 

Source
Expand description

Golden section search for the minimum of a unimodal function of one variable.

The search keeps an interval [a, b] known to contain the minimum and two interior points at the golden-ratio positions b − (b − a)/φ and a + (b − a)/φ. Comparing f at them discards one end; the surviving interior point is exactly where one of the next pair must be, so each iteration costs one new evaluation and shrinks the interval by 1/φ ≈ 0.618. No derivatives are used. For a function that is not unimodal on [a, b] it finds a local minimum.

See the book entry One-dimensional minimisation and line searches.

Structs§

GoldenSectionSearch
Golden section search on the interval given by bounds (required, one pair). The initial parameters are ignored apart from their length, which must be 1. Stops when the interval is shorter than the tolerance (default 1e-5) or after max_iterations (default 1000) iterations, and returns the midpoint of the final interval; iterations counts evaluations of f.