Clear Filters
Clear Filters

Solution very sensitive to initial guess?

7 views (last 30 days)
I am using fminunc and trying to minimize a sum of squared errors between experimental and model data in order to estimate the values of 4 parameters used in a differential equation. The differential equation is stiff and requires ODE23S. I notice that the minimized value and value of the 4 parameters that matlab gives as output is very sensitive to the initial guess values of the parameters that I input into fminunc. Also, (expectedly) MATLAB says the sum of squared errors it finds is a local minimum. So my question(s) are: a) What can I do so that regardless of what my initial guess of the parameters values are(of course, the guess should be within reason ), MATLAB gives the same minimized value and the same 4 parameter values. b) Can MATLAB find a global minimum for the sum of squared errors?
Thank you Soham

Accepted Answer

Walter Roberson
Walter Roberson on 11 Aug 2015
fminunc is never a global minimizer (except, of course, when the only local minima is also the global minima.)
Have you experimented with fminsearch() ?
You should probably be using the Global Optimization toolbox for a global minimization.

More Answers (1)

Alan Weiss
Alan Weiss on 17 Aug 2015
I am not sure that this will help, but I can suggest two things that have a chance of improving things for you:
  1. Use lsqnonlin, not fminunc. You will probably get faster, more reliable results. You will have to rewrite your objective function to give the vector of things that you square and sum for fminunc, because lsqnonneg wants that vector as the objective, not the sum of squares.
  2. Be careful and choose appropriate finite difference step sizes, as explained here.
And, as explained here, no Optimization Toolbox solver gives global solutions, only local, so you might have to take a variety of initial points to increase the likelihood that you arrive at the global minimum.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  1 Comment
Soham
Soham on 4 Sep 2015
Alan,
Thanks a lot and sorry for the late reply. Yes, I have started using lsqnonlin and it is giving faster/better results although not always (again dependent on initial conditions). I plan to use Multistart in order to study a number of points.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!