This namespace contains an implementation of Brent's method for finding the minimum of a real-valued function.
This namespace contains an implementation of Brent's method for finding the minimum of a real-valued function.
(brent-max f a b opts)
For convenience, we also provide the sister-procedure for finding the maximum of a unimodal function using Brent's method.
Negate the function, minimize, negate the result.
For convenience, we also provide the sister-procedure for finding the maximum of a unimodal function using Brent's method. Negate the function, minimize, negate the result.
(brent-max-commons f a b)
(brent-max-commons f a b opts)
For convenience, we also provide the sister-procedure for finding the maximum of a unimodal function using the apache commons implementation of Brent's method.
Negate the function, minimize, negate the result.
For convenience, we also provide the sister-procedure for finding the maximum of a unimodal function using the apache commons implementation of Brent's method. Negate the function, minimize, negate the result.
(brent-min f a b)
(brent-min f
a
b
{:keys [relative-threshold absolute-threshold maxiter maxfun
callback]
:or {relative-threshold (g/sqrt v/machine-epsilon)
absolute-threshold 1.0E-11
maxiter 1000
callback (constantly nil)}})
Find the minimum of the function f: R -> R in the interval [a,b] using Brent's Method, described by Richard Brent in Algorithms for Minimization without Derivatives.
Brent's method is a combination of a golden section search with a parabolic interpolation step. Parabolic interpolation can go wild if the candidate point is close to colinear with the search bounds, or of the points are too close together.
Brent's method prevents this by applying an internal test that forces a golden
section step every so often. (If you want the details, see parabola-valid?
above.)
Supports the following optional keyword arguments:
:callback
if supplied, the supplied fn will be invoked at each intermediate
point with the iteration count and the values of x and f(x) at each search
step.
:relative-threshold
defaults to around 1.49e8, the sqrt of the machine
tolerance. You won't gain any benefit attempting to set the value less than
the default.
:absolute-threshold
a smaller absolute threshold that applies when the
candidate minimum point is close to 0.
:maxiter
Maximum number of iterations allowed for the minimizer. Defaults to
1000.
:maxfun
Maximum number of times the function can be evaluated before
exiting. Defaults to (inc maxiter)
.
Find the minimum of the function f: R -> R in the interval [a,b] using Brent's Method, described by Richard Brent in [Algorithms for Minimization without Derivatives](https://books.google.com/books?id=AITCAgAAQBAJ&q=Brent%E2%80%99s#v=onepage&q=Parabolic&f=false). Brent's method is a combination of a golden section search with a parabolic interpolation step. Parabolic interpolation can go wild if the candidate point is close to colinear with the search bounds, or of the points are too close together. Brent's method prevents this by applying an internal test that forces a golden section step every so often. (If you want the details, see `parabola-valid?` above.) Supports the following optional keyword arguments: `:callback` if supplied, the supplied fn will be invoked at each intermediate point with the iteration count and the values of x and f(x) at each search step. `:relative-threshold` defaults to around 1.49e8, the sqrt of the machine tolerance. You won't gain any benefit attempting to set the value less than the default. `:absolute-threshold` a smaller absolute threshold that applies when the candidate minimum point is close to 0. `:maxiter` Maximum number of iterations allowed for the minimizer. Defaults to 1000. `:maxfun` Maximum number of times the function can be evaluated before exiting. Defaults to `(inc maxiter)`.
(brent-min-commons f a b)
(brent-min-commons f
a
b
{:keys [relative-threshold absolute-threshold maxiter maxfun
callback]
:or {relative-threshold (g/sqrt v/machine-epsilon)
absolute-threshold 1.0E-11
maxiter 1000
callback (constantly nil)}})
Find the minimum of the function f: R -> R in the interval [a,b] using Brent's Method, described by Richard Brent in Algorithms for Minimization without Derivatives.
This method is identical to brent-min
but uses the apache-commons
implementation of Brent's method. See brent-min
for more information.
Find the minimum of the function f: R -> R in the interval [a,b] using Brent's Method, described by Richard Brent in [Algorithms for Minimization without Derivatives](https://books.google.com/books?id=AITCAgAAQBAJ&q=Brent%E2%80%99s#v=onepage&q=Parabolic&f=false). This method is identical to `brent-min` but uses the apache-commons implementation of Brent's method. See `brent-min` for more information.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close