scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
golden(func, args=(), brack=None, tol=1.4901161193847656e-08, full_output=0, maxiter=5000)

Given a function of one variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol.

Notes

Uses analog of bisection method to decrease the bracketed interval.

Parameters

func : callable func(x,*args)

Objective function to minimize.

args : tuple, optional

Additional arguments (if present), passed to func.

brack : tuple, optional

Triple (a,b,c), where (a<b<c) and func(b) < func(a),func(c). If bracket consists of two numbers (a, c), then they are assumed to be a starting interval for a downhill bracket search (see bracket ); it doesn't always mean that obtained solution will satisfy a<=x<=c.

tol : float, optional

x tolerance stop criterion

full_output : bool, optional

If True, return optional outputs.

maxiter : int

Maximum number of iterations to perform.

Return the minimum of a function of one variable using golden section method.

See Also

minimize_scalar

Interface to minimization algorithms for scalar univariate functions. See the 'Golden' :None:None:`method` in particular.

Examples

We illustrate the behaviour of the function when :None:None:`brack` is of size 2 and 3, respectively. In the case where :None:None:`brack` is of the form (xa,xb), we can see for the given values, the output need not necessarily lie in the range (xa, xb) .

>>> def f(x):
...  return x**2
>>> from scipy import optimize
>>> minimum = optimize.golden(f, brack=(1, 2))
... minimum 1.5717277788484873e-162
>>> minimum = optimize.golden(f, brack=(-1, 0.5, 2))
... minimum -1.5717277788484873e-162
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.optimize._optimize.golden

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/optimize/_optimize.py#2533
type: <class 'function'>
Commit: