I may be wrong, but when you optimize a function, you may have to evaluate the optimal value of the outputs, performing various evaluations at each iteration.
In an interaction of the L-BFGS-B
algorithm you may have to perform (and often do) multiple evaluations / comparisons of values until you reach the optimal value for the parameters.
The maxiter
parameter controls the number of iterations the algorithm can perform.
The parameter maxfun
, refers to the number of evaluations / comparisons that the algorithm can make, at each iteration, about the objective function.
Or in other words:
The process of optimizing a function may require the optimizer to evaluate the value of the objective function several times with different sets of parameters.
The maximum number of interactions that the optimizer can run is controlled by the maxiter
parameter.
The maximum number of times that the objective function can be evaluated / tested, with different sets of parameters, is controlled by the parameter maxfun
.
For example:
We know that the execution of the optimization algorithm in a certain objective function will take 10 interactions, with each interaction requiring evaluation of the values obtained by 5 times, until reaching the optimal value.
Then we have that maxiter
must equal 10 and maxfun
equal 10 * 5 = 50.
Otherwise the function will not rotate the minimum number of times to have its parameters optimized.