Nonlinear fitting does not perform appropriately

I have a list as below one:

 mustbefitted={{0., 1.}, {4.4, 0.982211}, {8.9, 0.961575}, {13.3, 0.942571}, {17.8, 0.923857}, {22.2, 0.906203}, {25.1, 0.046994}};


I wish to fit the list with a function as a - b t^c

NonlinearModelFit[mustbefitted, a - b t^c, {a, b, c}, t];


But unfortunately the above fitting command does not perform correctly and I could not understand the mean of the massage after running the function i.e., The Jacobian is not a matrix of real numbers at {a,b,c} = {1.,1.,1.}!!!

• For reference, the message is "The Jacobian is not a matrix of real numbers at {a,b,c} = {1.,1.,1.}." Please add this type of information to your questions in future! – Carl Lange Aug 12 at 17:51
• Mind the capitalization NonlinearModelFit not NonLinearModelFit. – rhermans Aug 12 at 17:54
• Most of the issues stem from the first point: {0., 1.}, which represents an indeterminate value in your fit function. It does not look like a - b t^c is a particularly good fit for this data either. – eyorble Aug 12 at 18:19

So I took a look at your data,

ListLinePlot[mustbefitted]


First I'd play with Manipulate to see if I can use the model I have and see if I can get anywhere close.

Manipulate[Plot[a - b t^c, {t, 0, 25.1}, ImageSize -> Large, Epilog -> Point[mustbefitted]], {a, 0.1, 5000000}, { b, -5, 5}, {c, -5, 50}]


It doesn't look good....the only values b and c that will give us that sharp drop off you have are quite high and a doesn't affect on it anymore.

But the data looks like an extremely linear piecewise function.

data = {{0, 1}, {4.4, 0.982211}, {8.9, 0.961575}, {13.3, 0.942571}, {17.8, 0.923857}, {22.2, 0.906203}}

lm = LinearModelFit[data, x, x]
lm2 = LinearModelFit[{{22.2, 0.906203}, {25.1, 0.046994}}, x, x]


Have a look at the residuals...

ListPlot[lm["FitResiduals"], Filling -> Axis]
ListPlot[lm2["FitResiduals"], Filling -> Axis]


Looks pretty good!...your data is awfully linear, except for the last data point compared to the rest.

f[x_] := Piecewise[{{lm[x], x < 22.2}, {lm2[x], x >= 22.2}}]
Plot[f[x], {x, 0, 25.1}, Epilog -> {Red, Point[mustbefitted]}, PlotRange -> All]


Not sure this is exactly what you're looking for, but unless you can get a hand on more data points, or find a different model (the model you have doesn't seem to be the right one), there isn't much of a chance to get something better than this.

• Thankx so much for your guide. Please let me check – Inzo Babaria Aug 13 at 9:09