# What does the following error message mean, in the context of NonlinearModelFit?

I am deliberately not including data or a model for this question, as I want a more general answer so that I may be able to trouble shoot this myself in the future.

When performing a fit, usually a fit with more than two parameters, I occasionally see the error message:

The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the gradient is larger than the tolerance specified by the AccuracyGoal option. There is a possibility that the method has stalled at a point that is not a local minimum.

More often than not, the fit looks good by eye, and the fitted parameter values are reasonable.

So the questions are:

• What does this error really mean?
• Does it matter, especially if the fit looks good and the fit parameters are reasonable? That is, how trust worthy are the results?
• How can one prevent this error? I have often played with PrecisionGoal and AccuracyGoal but it doesn't seem to have much of an effect.

I appreciate this problem will have solutions that vary depending on the individual case, but I often fit with very different models and would like some advice on how to avoid such errors, and trouble shoot them myself -- rather than just post the problem here.

• – JimB
Aug 25 '19 at 22:41
• So I have seen your answers for these questions and were among the first things I tried. I always scale my fit routines such that the fitted parameters are the scales -- i.e. everything fits on a scale between 0 and 2. I also get rid of any approximated numbers -- nothing with a decimal point for initial guesses. As for over parameterisation -- well there I am not will to do anything because that is what physics tells me the parameters are.
– Q.P.
Aug 25 '19 at 22:54
• "Cap'n! I can't change the laws of physics." Maybe. But remember that it is not just about the model (i.e., the physics) but also how the data was generated. While the model might very well be correct, the data might not support the ability to estimate all parameters. (And that means the "kind" of data rather than the "amount" of data.) I know you want a general answer but if you have a specific example, I'd be more than happy to see what might be going on if you open a chat.
– JimB
Aug 25 '19 at 23:02
• For God's sake's Jim I'm a physicist not a statistician! A chat sounds good -- how do we do this?
– Q.P.
Aug 25 '19 at 23:34
• I thought I knew how to open a chat but now I'm not sure. Here's a link to what I'm hoping will work: chat.stackexchange.com/rooms/info/97857/….
– JimB
Aug 25 '19 at 23:43