Bad Initial Guess for "b"

Let's repeat the curve fit for the second example in the previous page, but instead of guessing "b

Let's get the rising edge data, and make it start at t=0.

Rising Edge Raw Data 

and fit the data to the equation:

Asymptotic equation

Last time we guessed a=1, b=-2 and got a good fit to the data.  This time let's guess a=1, b=2 and see what happens.

Bad initial guess 

Now, do the fit.

Bad fit

Clearly, the fit is not very good.  If we look at the final result, we see that Matlab gets a=-2737 and b=0.000166.  Clearly this is wrong and not nearly as good a fit as before.

Fitted Parameters 

This illustrates the importance of choosing good initial guesses when doing a non-linear fit.

Back