In fitting the following data, if I first log transform the y-values and use LinearModelFit
I get a set of parameters that fits the data:
data = {{248, 0.032}, {280, 0.0498}, {327, 0.0971}, {360, 0.162}};
loggedData = ReplaceList[data, {__, {x_Integer, y_Real}, ___} -> {x, Log[y]}];
linFit = LinearModelFit[loggedData, t, t];
linFit["BestFitParameters"]
{-7.03516, 0.0144417}
However, if I instead use NonlinearModelFit
on the data directly (not log transformed), I get nonsense
data = {{248, 0.032}, {280, 0.0498}, {327, 0.0971}, {360, 0.162}};
NonlinearModelFit[data, a Exp[b t], {a, b}, t]["BestFitParameters"]
{a -> 0., b -> 1.}
Have I found the one set of points that NonlinearModelFit
cannot handle? It seems that any other exponential data I feed in can be fit just fine by NonlinearModelFit
. Are there any additional directives I can give to NonlinearModelFit
to get a sensible result?
NonlinearModelFit[data, a Exp[b t], {{a, 0}, {b, 0}}, t]["BestFitParameters"]
and you will find that it works correctly. $\endgroup$ – Oleksandr R. Mar 5 '13 at 13:41