In the function fit, what exactly is the difference between the 2 parameters MaxFunEvals & MaxIter?

7 views (last 30 days)
In the function fit(Curve Fitting Toolbox), what exactly is the difference between the 2 parameters MaxFunEvals & MaxIter?
  1 Comment
dpb
dpb on 5 Aug 2019
In nonlinear fitting there's more than one function evaluation per solution iteration -- the number of "outer" iterations is MaxIter while the number of total function evaluations is MaxFunEvals There's no specific relationship between the two; if one has a very expensive functional, one can limit total time by not allowing more than some N evaluations. Of course, limiting either risks terminating before convergence even if there may be a final solution.

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 5 Aug 2019
If you had to walk through an unfamiliar darkened room and you had a stick, you might tap the ground in front of you, in front and to the left, and in front and to the right to determine where the path is clear. Once you know the direction where it's safe to move, you take a step and repeat the process of tapping and stepping.
Tapping the ground is a function evaluation. Stepping is an iteration. One step (iteration) may require multiple taps (function evaluations) to complete.
  3 Comments
Bruno Luong
Bruno Luong on 13 Aug 2019
Edited: Bruno Luong on 13 Aug 2019
If you provide the Jacobian the number of function evaluations will be close to the number iterations.
If not the minimizer needs to evaluation additional N function-evaluations per iteration and estimate the Jacobian by finite difference. So the number of function evaluations is roughly N x m, whener N is the number of unkown parameter and m the number of iterations.
Beside that there is also some extra function evaluation duting a "line search" meaning once the descent direction is known, the optimizer might need more than 1 iteration to goes down before changing the direction.
On top of that the selected algoritm also affect both counters for reach the same performance.
To set correctly the parameters, the most important thing to know is whereas you provide or not the Jacobian to the minimizer.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!