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.

1 2 |

`this` |
An optimization object. |

`previousfopt` |
The previous value of the objective function. |

`currentfopt` |
The current value of the objective function. |

`previousxopt` |
The previous value of the parameter estimate matrix. |

`currentxopt` |
The current value of the parameter estimate matrix. |

Return a list with the following elements:

- this
The updated optimization object.

- terminate
TRUE if the algorithm terminates, FALSE if the algorithm must continue.

- status
The termination status could be 'maxiter', 'maxfuneval', 'tolf' or 'tolx' if

`terminate`

is set to TRUE, 'continue' otherwise.

Author of Scilab optimbase module: Michael Baudin (INRIA - Digiteo)

Author of R adaptation: Sebastien Bihorel (sb.pmlab@gmail.com)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.