0

I'm minimizing a non-linear function of 3 variables with fminsearch in Octave. Because, the solution gets close to the minimum, but not close enough, I need to investigate the behavior during the iterations.

I know that Matlab can set optimset('PlotFcns',@optimplotfval) to plot the iterations, but I do not have that luxury in Octave. Is there a way to store the variables in a vector, each time they are passed to my function? My function is defined separately, and its name is passed as a handle to fminsearch.

gciriani
  • 611
  • 2
  • 7
  • 19
  • In GNU/Octave you have the luxury to read, understand and modify the sourcecode so just dive into `m/optimization/fminsearch.m` and UTSL!. If you provide source and the function you want to minimize (btw, fminsearch tries to maximize, just to be clear) we can help further. – Andy Dec 19 '18 at 05:16
  • And of course you can store the evaluation vector and the result inside your function – Andy Dec 19 '18 at 05:23
  • @Andy, I'm not as proficient a user to intervene on the code of fminsearch. Regardless, you say it maximizes, but "doc fminsearch" states the opposite: Find a value of x which minimizes the function fun. You suggest to store the results inside my function; I guess I have to declare the variables global; I just read the explanation on how global works, so I'll try. I'll also try to edit my post and add my code. – gciriani Dec 19 '18 at 14:03
  • You are absolutely right because minimization and maximization (I just read nmsmax where default is to maximize) Sorry for the confusion – Andy Dec 19 '18 at 15:06
  • crossposting on the octave help mailinglist: http://octave.1599824.n4.nabble.com/fminsearch-plot-tools-td4690445.html – Andy Dec 19 '18 at 17:53
  • 1
    @Andy I entered the bug in the Octave bug reporting interface, and it has been addressed: https://savannah.gnu.org/bugs/index.php?55261 It will be part of the 5.0 release in January 2019. – gciriani Dec 21 '18 at 20:24

0 Answers0