I fit some data with FindFit
and NonlinearModelFit
with some constraints and I am not getting a good fit with my data. I read around other questions such as FindFit not giving a good fit despite good initial parameters, FindFit: why do I get negative value as result?, FindFit returns worse result when putting constraints on parameters, and some of them have initial starting values that do help the fit. Unfortunately, I do not have an exact starting value for my parameters. All i know is that in my data, kd'/kd ~ 10^-6. I am just wondering if there are other ways to fix a FindFit
in order to get a better fit.
data = { {75, 5.965}, {68.75, 6}, {63.45, 6.01}, {58.95, 6.03}, {55, 6.04}};
func = ((6.02*kd) + (deltaa''*x) + (5.65*kd'))/(kd + kd' + x);
ff = FindFit[data, {func, kd > 0, kd' > 0, 5.62 < deltaa'' < 6.02}, {{kd}, {kd'}, {deltaa''}}, x]
(*{*kd -> 1395.46, kd' -> 0.00336158, deltaa'' -> 5.71117}*)
fitfunc = func /. ff;
nlmfit1 = NonlinearModelFit[data, {func, kd > 0, kd' > 0, 5.62 < deltaa'' < 6.02}, {kd, kd', deltaa''}, x]
(*(8400.66 + 5.71117 x)/(1395.46 + x)*)
Show[ListPlot[data],Plot[{fitfunc}, {x, 75, 55}, PlotLegends -> "fitfunc"]]
In my script above, I did not add any starting parameters because I am estimating different values and changing them to see how they fit the data. I know kd and kd' are both positive as well as kd'/kd ~ 10^6 that was stated above. Even though I am constantly trying to figure out estimated initial values, it is not changing the fit. I am just wondering why my fit is bad and what else can I do in order to get a better fit.