My question about tracking the progress of a minimisation/fitting process is two-fold:
1. The first part of my question can be considered a slight duplicate/follow-up of this question. There the OP asked what exactly is passed to the StepMonitor-Option when using the "DifferentialEvolution"-method. The answer by Oleksandr R. states that only the fittest individual of each generation is passed. This is fine by me but when I try the following nothing is passed:
data = BlockRandom[SeedRandom[12345];
Table[{x, Exp[-2.3 x/(11 + .4 x + x^2)] + RandomReal[{-.5, .5}]},
{x, RandomReal[{1, 15}, 20]}]];
nlm = Reap@NonlinearModelFit[data, Exp[a x/(b + c x)], {a, b, c}, x,
Method -> {NMinimize, Method -> {"DifferentialEvolution"}},
StepMonitor :> Sow[{a, b, c}]]
compare this to the same expression using EvaluationMonitor instead of StepMonitor.
Question: Is what is passed to/by EvaluationMonitor the fittest individual of the current generation (like Oleksandr R. suggested for StepMonitor which sadly seems not to be accurate any more)
Question 2 Is there a straightforward way to pass the value of the fitness/cost-function of said best individual i.e. the squared differences between estimate and data?
Optimization`FindFit`ObjectiveFunction, it is indeed a very convenient way to create aNumericalFunction! There is alsoOptimization`FindFit`ResidualFunction. – Alexey Popkov Jun 06 '16 at 03:26ANOVATable). This is exactly double of the last value coming out ofOptimization`FindFit`ObjectiveFunction. – demm Jun 06 '16 at 19:14ObjectiveFunctionbut it does not work. Evaluating for instanceobj[{1,2,3}]yields some unevaluated expression containingExperimental``NumericalFunctionI triedNeeds["Optimization"]which results in annoopen`-error – Sascha Jun 06 '16 at 21:45