[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54420] fminsearch default TolFun is different
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #54420] fminsearch default TolFun is different from Matlab |
Date: |
Wed, 1 Aug 2018 14:14:32 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0 |
Update of bug #54420 (project octave):
Status: None => Confirmed
Summary: fminsearch innacuracy => fminsearch default TolFun
is different from Matlab
_______________________________________________________
Follow-up Comment #1:
I'm not sure there is anything to fix here.
First, fminsearch is included by default in core Octave in
scripts/optimization so there is no need to load the 'optim' package.
Second, optimization routines are known to be very sensitive to the initial
starting location. In this case, it appears that the wobble function has at
least two local minima that are quite close together and Octave chooses one
while Matlab chooses a different one. That is just a hazard of numerical
analysis, but not what I would call a true incompatibility with Matlab.
Regarding tolerance, it appears that Matlab has changed the values of some of
the default options they feed to the fminsearch algorithm. I'm pretty sure
Octave used to be in sync, but now Matlab passes
Display
Level of display (see Iterative Display):
'notify' (default) displays output only if the function does not
converge.
'final' displays just the final output.
'off' or 'none' displays no output.
'iter' displays output at each iteration.
FunValCheck
Check whether objective function values are valid. 'on' displays an error when
the objective function returns a value that is complex or NaN. The default
'off' displays no error.
MaxFunEvals
Maximum number of function evaluations allowed, a positive integer. The
default is 200*numberOfVariables. See Tolerances and Stopping Criteria.
MaxIter
Maximum number of iterations allowed, a positive integer. The default value is
200*numberOfVariables. See Tolerances and Stopping Criteria.
OutputFcn
Specify one or more user-defined functions that an optimization function calls
at each iteration, either as a function handle or as a cell array of function
handles. The default is none ([]). See Output Functions.
PlotFcns
Plots various measures of progress while the algorithm executes. Select from
predefined plots or write your own. Pass a function handle or a cell array of
function handles. The default is none ([]):
@optimplotx plots the current point.
@optimplotfunccount plots the function count.
@optimplotfval plots the function value.
For information on writing a custom plot function, see Plot Functions.
TolFun
Termination tolerance on the function value, a positive scalar. The default is
1e-4. See Tolerances and Stopping Criteria. Unlike other solvers, fminsearch
stops when it satisfies both TolFun and TolX.
TolX
Termination tolerance on x, a positive scalar. The default value is 1e-4. See
Tolerances and Stopping Criteria. Unlike other solvers, fminsearch stops when
it satisfies both TolFun and TolX.
whereas Octave does
if (nargin == 1 && ischar (fun) && strcmp (fun, "defaults"))
x = optimset ("Display", "notify", "FunValCheck", "off",
"MaxFunEvals", 400, "MaxIter", 400,
"OutputFcn", [],
"TolFun", 1e-7, "TolX", 1e-4);
In particular, the TolFun argument is 1e-7 for Octave versus 1e-4 for Matlab.
That seems reasonable to make consistent so I have re-titled the bug report.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54420>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/