I have the following defined:

lvf1 = Table[{i, 1/(10 - i)}, {i, -100, 100}];


If I just run this, it gives me a "Power: Infinite expression 1/0 encountered." error, so I added this to remove that point from the dataset:

lvf1 = Delete[lvf1, 111];


It looks like this:

ListPlot[lvf1]


Now, when I run this:

nlm = NonlinearModelFit[lvf1, a/(b - x) + c, {a, b, c}, x];


I get all kinds of errors:

Why!? I've used the NonlinearModelFit function like this elsewhere, and it typically works. I can't seem to get it to work with any reciprocal/inverse type function. Please help!

Provide a non-integral initial point:

NonlinearModelFit[lvf1, a/(b - x) + c, {a, {b, π^2}, c}, x]

• A non-integral initial point for b does remove the error messages but the initial value of $\pi$ doesn't result in an appropriate fit. If {a, {b, 9.1}, c} is used, then an appropriate fit is found. – JimB Nov 20 '18 at 1:08

You don't need initial points when using Method->"NMinimize"

nlm = NonlinearModelFit[lvf1, a/(b - x) + c, {a, b, c}, x,Method -> "NMinimize"];
Normal[nlm] (*  -8.88269*10^-9 + 1./(10. - x)  as expected*)

Show[{Plot[Normal[nlm], {x, -100, 100}, PlotStyle -> Thickness[.02]],ListPlot[lvf1, PlotStyle -> Red]}]


• Do you mean that using Method -> "NMinimize" starts out with either better automatic initial points or that using that method is less sensitive in this case to the automatic initial points (which I thought was 1 for all parameters)? It's still an iterative method so there must be initial points. – JimB Nov 20 '18 at 14:26
• @ JimB I don't know which initial points NMinimize uses, often the method is more robust than the default methods. – Ulrich Neumann Nov 20 '18 at 14:47
• Thanks. I see now. That method is more robust which means that it is much less often that one needs to supply customized initial values. – JimB Nov 20 '18 at 15:13