Generic code for iterative minimisers.
Function options
~~~~~~~~~~~~~~~~
func - The function to minimise.
dfunc - The function which returns the gradient vector.
d2func - The function which returns the hessian matrix or approximation.
f_args - The tuple of arguments to supply to the function func.
df_args - The tuple of arguments to supply to the function dfunc.
d2f_args - The tuple of arguments to supply to the function d2func.
xk - The parameter vector which on input is the initial values, x0.
fk - The function value which on input corresponds to x0.
dfk - The gradient vector which on input corresponds to x0.
d2fk - The hessian matrix or approximation which on input corresponds to x0.
xk_new - The parameter vector for the next iteration which on input can be anything.
fk_new - The function value for the next iteration which on input can be anything.
dfk_new - The gradient vector for the next iteration which on input can be anything.
d2fk_new - The hessian matrix for the next iteration which on input can be anything.
func_tol - The cutoff value used to terminate minimisation by comparison to the difference in function values between iterations.
maxiter - The maximum number of iterations.
print_flag - A flag specifying how much information should be printed to standard output during minimisation:
The print flag corresponds to:
0 - No output.
1 - Minimal output.
2 - Full output.
Returned objects
~~~~~~~~~~~~~~~~
The minimised parameter vector, function value at the minimum, number of iterations, and a warning flag are returned.
The warning flag corresponds to:
0 - Minimisation terminated successfully.
1 - Maximum number of iterations have been reached.
|