How to keep signs of input parameters fixed while using "levenberg-marquardt" algorithm for lsqcurvefit?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
If I use upper and lower bounds for my parameters, the algorithm switches to trust region method automatically. Is there any other way to just keep the signs constant during iterations?
2 Kommentare
Matt J
am 15 Jan. 2017
But why cling to Levenberg-Marquardt when it is not natural for the problem you are trying to solve? If you have bounds, why oppose MATLAB's efforts to choose a solver more appropriate for that?
Antworten (1)
John D'Errico
am 15 Jan. 2017
Bearbeitet: John D'Errico
am 15 Jan. 2017
An easy solution is to change your model slightly using a transformation. For example, suppose you wanted to solve for coefficients of the model
y = a*x
but you wanted to ensure that a was ALWAYS positive, but you don't want to apply bound constraints? Instead solve for the coefficients of the model:
y = b^2*x
As you can see, b^2 will always be positive, so there is never a chance that b^2 will change sign on you. When you are done, just transform b back into a as
a = b^2
Yes, it is a hack. But it allows you to formulate a problem to work in the solver you want to use, without the employment of explicit bound constraints.
2 Kommentare
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!