05-05-2010 05:51 AM
The initial parameters are important. I have used a significant amount of code just for generating the initial parameter values; based on theory.
Check out this thread for useful info about implementing the partial derivatives etc.
05-05-2010 08:51 AM
I was only suggesting that the random initial guess was better than the array of "ones" for this particular problem. As Battler mentions the initial guess is quite important, and most curve fitting applications devote significant effort to estimating the parameters before passing to the Lev-Mar algorithm. For example, you might be able to fit your curve using a single exponential (a1, b1), then fit the residual of that regression using another exponential (yielding a2,b2), as a way of estimating the first two exponentials in your model. You might also be able to reuse previous experiments/fits as starting points for the current problem.
-Jim