optimisation: lsqnonlin and fminsearchbnd

3 views (last 30 days)
Hello,
I have ODE system, which I try to optimise. I've imposed the limits for the variable values (I did first fminsearchbnd followed by lsqnonlin optimisation). However, I wonder how can I make sure that the solution of each equation within the ODE system is always positive?
Also, I'm getting the solutions from the optimisations (which have sense), however I've got an information that the solution did not converged. Thus, I'm not sure if I can trust obtained values of the parameters. This is important also for the sensitivity studies of the parameters. How can I make sure that the convergence will be achieved?
Thank you in advance for any suggestions.

Answers (1)

William Rose
William Rose on 8 Apr 2021
  1. You said you want to ensure that the solutions to a set of differential equations are positive. There is no way to ensure such an outcome, when using the Matlab ODE solvers, as far as I know. If a negative solution is non-sensical, then I think your differential equations, combined with sensible bounds for parameters, should make negative values impossible. If I were getting negative values, I would double check my equations and my parameters.
  2. You said you get reasonable solutions when you optimize, and you said that the solver reported that it did not converge. This can happen if the function being minimized has a minimum region with a flat valley floor. Along this valley, the two fitted parameters trade off with one another, so the minimization does not converge, because any point in the valley is as low as any other point. This is a sign that the fit is insensitive to certain tradeoffs of parameters, within some limted range. That may be OK. It depends on your understanding of the model If pbothparameters are reasonable and if it is plausible that tehy could trade off with one abnother to give a good fit, then use the fitted values without worry. If this happens to me, I run the optimization many times. Each time, I make an initial guess at a different randomly chosen point in the acceptable space of parameters. After each trial, I save the set of best-fit parameters and the associated minimum value (goodness of fit). After many such trials, I choose the parameters that gave the best overall fit - if they are reasonable. If you use Matlab's fmincon() or lsqnonlin(), you can specify parameter bounds, so your fitted parameters should always be reasonable, if you specify the reasonable upper and lower bounds. I sometimes inspect the coviance matrix for the fitted parameters, and sometimes I compute the correlation matrix. If the correlation between a particular pair of parameters is close to +1 or -1, then those two parameters may be trading off with eachother to produce a good fit, as discussed above.. See here for a discussion of how to use corrcov() to compute the correlation matrix for a set of fitted paramters from lsqnonlin(), if this is of interest to you.
Good luck!

Categories

Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!