MATLAB: Parameter fitting without getting local minima

kineticslocallsqcurvefitminimumparameter

I am currently determining kinetics for a simple reversible first order system.
I am trying to fit my rate constants (k) so the model matches my experimental data.
However, I am currently getting the next message:
Local minimum possible.
lsqcurvefit stopped because the size of the current step is less than
the default value of the step size tolerance.
<stopping criteria details>
I think my fit is not optimal and I am (probably?) currently at a local minimum.
Hence my question: how can I fit these parameters to an absolute minimum?
Besides the message, my fit is terrible: (stars = experimental data, red line = model)
I added my scripts in case someone wants to take a look.
Thanks in advance!

Best Answer

The local minimum is likely the best you can hope for, considering that the parameters are constrained. Are you certain that they need to be constrained to be between 0 and 1, or simply constrained to be greater than 0? (I did not get an appropriate fit when I eliminated the upper-bound constraints.)
Also, be certain that your model is correct. I find your code difficult to follow.
If you have the Global Optimization Toolbox, one option is to use the genetic algorithm (ga) function. I wrote a version of the code you are quoting using ga. I attach it here. Make appropriate changes for the parameters and constraints so that it will work with your model. (I usually set this up in a for loop and have it run about 100 times, saving the best, determined by minimum fitness, as the overall best fit. It could turn out that the lsqcurvefit estimates are the best estimates.)