The function to be minimised
The initial location to start the search from
Control parameters, as an object
Return information about the best found point so far.
Has the algorithm converged?
Any additional data returned by the target function, for this point
The number of times that target
has been called so far
The number of times that step has been called so far
The best found location
The value of target(location)
Helper function to run the algorithm until converged. This is very basic and not really intended to be used - you should probably build logic around step directly, or if you want a simple interface use the fitSimplex function.
The same object as result. Note that the
algorithm may not have converged, so you should check the
.converged
field.
The maximum number of iterations of the algorithm (calls to step to take. If we converge before hitting this number we will return early.
Has the algorithm converged?
Any additional data returned by the target function, for this point
The number of times that target
has been called so far
The number of times that step has been called so far
The best found location
The value of target(location)
Returns an array of the points that make up the Simplex. This is primarily provided for visualisation or debugging, but it could also be used to derive alternative early exit criteria.
An array of objects, sorted from best to worst. Each
object has fields location
and value
.
Advance the optimiser one "step" of the algorithm. This will
usually evaluate target
once or twice, depending on if
proposal finds an improved point or not.
true
if the algorithm has converged, false
otherwise. For details about the best point so far, see
result
Generated using TypeDoc
Start, improve and interrogate an optimisation. Unlike fitSimplex, which does this in a single step, the
Simplex
class creates mutable state representing a (potentially) partially-completed optimisation process, which you are then responsible for pushing around in a loop. This means that if the optimisation is slow and you want to make it cancelleable, or if you want to report back anything about the progress of the optimsiation, you are free to do so as you'll only ever hit a method here for as long as it takes to call yourtarget
function a few times.Example