How do I mimick lscqcurvefit (mathworks.nl/help/toolbox/optim/ug/lsqcurvefit.html) with NonlinearModelFit? I.e., how do I use the trust-region-reflective algorithm in Mathematica ? Is there some undocumented equivalent to MaxFunEvals?
@Rojo Yes, sure, I read this, and tried it, something like SetOptions[NonlinearModelFit, MaxIterations -> Automatic, Method -> {NMinimize, Method -> {"NelderMead", "PostProcess" -> {FindMinimum, MaxIterations -> 500, AccuracyGoal -> 2, Method -> {"Newton", "StepControl" -> "TrustRegion", "StartingScaledStepSize" -> 1}}}, AccuracyGoal -> 2}] but is NelderMead any good? I am not a specialist in numerical math and I am getting quite frustrated finding out which algorithm to use how ...
BTW: Which algorithm does NonlinearModelFit use by default? I.e., what is meant by Automatic? I.e., which one of "ConjugateGradient", "Gradient", "LevenbergMarquardt", "Newton", "NMinimize" ?
@RolfMertig I don't know for sure, but my gut feeling would be: "InteriorPoint" if any constraints are specified; "LevenbergMarquardt" otherwise. The method used by MATLAB doesn't seem to have been implemented in Mathematica. Any reason you need to use that specific method?
@RolfMertig Nelder-Mead is relatively decent; it isn't strictly speaking a global minimizer though. Its main advantage is that it's a derivative-free method that requires relatively few function evaluations (compared to, e.g., differential evolution).
Unfortunately Mathematica's implementation of the Nelder-Mead method kind of works against that by not remembering what the function values were at points that had already been tested, so it evaluates the objective function again every time. (This may be intended for use with stochastic objective functions, but IMO it's not the best idea for a default.)