exponential with offset fitting


I have a simple data set that appears to be two parts, a linear region followed by a section that appears to be exponential. I have set cursors to delineate the region to fit with an exponential.  Since it is an increasing exponential I have seeded the coefficients with some values, 0.1,0.1, and -0.001.  Fit to an exponential is passable, but not great.  When I try the same thing but substituting the exponential with offset as recommended it fails on iteration 1.  I would actually prefer the offset version of the fit.  What is amiss?  The file is attached.




Note that I took the implementation of exp_XOffset function as a chance to correct something that had annoyed me a great deal: the plain exp function fits 1/tau, whereas the exp_XOffset function fits tau directly. So I used -1000 as the initial guess for tau and it fit fine:

CurveFit/G/TBOX=790 exp_XOffset CellSwell[pcsr(A),pcsr(B)] /X=CellTime /D
  Fit converged properly
  Curve fit with data subrange:
  fit_CellSwell= W_coef[0]+W_coef[1]*exp(-(x-W_fitConstants[0])/W_coef[2])
  V_chisq= 4.84414e-05;V_npnts= 10;V_numNaNs= 0;V_numINFs= 0;
  V_startRow= 15;V_endRow= 24;
  Coefficient values ± one standard deviation
    y0  =-0.055232 ± 0.0118
    A   =0.07162 ± 0.0103
    tau =-569.33 ± 46.2
    X0  =1221.45



Hi John,

Didn't see that coming.  Thanks for the response.  Also fitting exponentials, especially positive ones is tricky. Do you have any best practices/advice for seeding coefficients.  My guess the ones you know have already been incorporated.  Any guidance would be welcome.


As I think you have already figured out, automatic guessing doesn't work for growing exponentials. The /G flag you can see in my fit is the "manual guess" flag. I use the dialog and the Graph Now button to get something close. Most of the coefficients don't have to be particularly close- y0 and amplitude are linear coefficients and should be OK to be pretty far off. The decay constant needs to be moderately good- that is, the curvature should be an approximate match to the data. So the line doesn't have to actually go through the data, but it should look similar to the data.

And, of course, don't let a growing exponential grow too long :)