This function determines whether the optimization must continue or terminate.
If the verbosetermination
element of the optimization object is
enabled, messages are printed detailing the termination intermediate steps.
The optimbase.terminate
function takes into account the number of
iterations, the number of evaluations of the cost function, the tolerance on x
and the tolerance on f. See the section "Termination" in
vignette('optimbase',package='optimbase')
for more details.
optimbase.terminate(this = NULL, previousfopt = NULL, currentfopt = NULL,
previousxopt = NULL, currentxopt = NULL)
An optimization object.
The previous value of the objective function.
The current value of the objective function.
The previous value of the parameter estimate matrix.
The current value of the parameter estimate matrix.
Return a list with the following elements:
The updated optimization object.
TRUE if the algorithm terminates, FALSE if the algorithm must continue.
The termination status could be 'maxiter', 'maxfuneval',
'tolf' or 'tolx' if terminate
is set to TRUE, 'continue'
otherwise.