lsqcurvefit: Local minimum possible... but clearly visible minima

22 Ansichten (letzte 30 Tage)
Ralf Schmauder
Ralf Schmauder am 1 Mär. 2021
Beantwortet: Alan Weiss am 1 Mär. 2021
Hallo,
I optimze a parameter (it is not an f(x) type dependence) on a dataset with lsqcurvefit. I always get "Local minimum possible"
However, if I ran manual loop and plot the sum of the squared residues, a minima is visible.
With default options, I get resonable results when starting from low numbers, e.g.10, when starting from higher values I get apparent minima ranging from 3000-7000 are found. Reason is likely the "roughness" of the squared residues vs. the parameter:
With playing with 'FunctionTolerance' the system now finds values ~ 2444, already quite good but not the actual mnima of 2398. Apperently the programm gets stuck in rather local mimima.
Are there any options I am missing?
Are there better ways than using lsqcurvefit?
I do not need a very accurate parameter, natural numbers woudl be suffitient.
Surely I coudl always run a loop through all posible parameters, but I hoped to save time with lsqcurvefit.
Surprizingly the "optimize" function ogf IgorPro handles this without problems, But I want too keep everything in MATLAB if possible.
Any advice is apprciated.
chers
Ralf

Antworten (2)

Star Strider
Star Strider am 1 Mär. 2021
If you have the Global Optimisation Toolbox, many of those functions (ga is my favourite) will search the entire parameter space for the best parameter set. The point is that an optimisation fundtion that does not use gradient descent will likely be what you want. Another option is fminsearch, however it is not as robust as ga and the others.
  2 Kommentare
Ralf Schmauder
Ralf Schmauder am 1 Mär. 2021
Unforunately it does not help me here: I do NOT have an y=f(x) functions as ga and fminsearch seem to assume.
I have a data set which I can describe with a procedure depending on one parameter, which I want to optimize.
Anyhow, thanks for pointing me to ga, it will help me with other problems.
cheers
Ralf
Star Strider
Star Strider am 1 Mär. 2021
As I understand it, lsqcurvefit requires a function handle as its first argument, implying that you have some sort of functional relationship expression for your objective function with respect to the data. The data themselves may not have been created by a functions, however some sort of relationship appears to exist, as expressed by the objective function you supplied to it, or lsqcurvefit would completely fail.
Seeing your existing code (and perhaps data) and a reasonably detailed description of exactly what you want to do would be helpful.

Melden Sie sich an, um zu kommentieren.


Alan Weiss
Alan Weiss am 1 Mär. 2021
You could try to use fminbnd, which assumes no smoothness and is pretty efficient at 1-D minimization problems.
Alan Weiss
MATLAB mathematical toolbox documentation

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by