Simplex#
See Nelder-Mead Simplex for more information on the Nelder-Mead Simplex method.
- minimisers.simplex.fMinSearch(funfcn, x, options, dis, varargin)#
Perform a Nelder-Mead Simplex minimisation of an objective function.
- Parameters:
funfcn (
function
) – The function to minimise.x (
vector
) – The starting point to minimise from.options (
struct
) – Controls options for the algorithm.dis (
string
) – Options for how to display algorithm output.varargin (
options
) – Other options from the Mathworksfminsearch
.
- Returns:
x (vector) – The minimum value found.
fval (vector) – The objective function value at output point
x
.exitflag (integer) –
Reason
fMinSearch
stopped:1 if converged;
0 if max iterations/evals exceeded;
-1 if the output function returned an error.
output (struct) – Diagnostic information about the optimisation process.
Notes
See also MathWorks
fminsearch
doc page: https://www.mathworks.com/help/matlab/ref/fminsearch.html
- minimisers.simplex.runSimplex(problemStruct, controls)#
Run the Nelder-Mead simplex algorithm for a given problem and controls.
- Parameters:
problemStruct (
struct
) – the Project struct.controls (
struct
) – the Controls struct.
- Returns:
problemStruct (struct) – the output project struct.
result (struct) – the calculation and optimisation results object.
- minimisers.simplex.simplexIntrafun(x, problemStruct, controls, params)#
Produce a chi-squared fit value at a point for a given problem and controls.
Used as the objective function for Nelder-Mead simplex.
- Parameters:
x (
vector
) – The point to evaluate.problemStruct (
struct
) – The problem struct for calculation.controls (
struct
) – The controls struct for the calculation.params (
struct
) – A struct containing parameter fit information.
- Returns:
fval (float) – The chi-squared value at
x
.result (struct) – The result struct from the reflectivity calculation.
- minimisers.simplex.simplexXTransform(x, params)#
Convert unconstrained variables into their original domains.
- Parameters:
x (
vector
) – The point to transform.params (
struct
) – Parameter fit information.
- Returns:
xtrans – The point
x
transformed for the parameter bounds.- Return type:
vector