From: Olaf T. <ola...@un...> - 2010-08-29 10:58:41
|
On Fri, Aug 27, 2010 at 05:30:10PM -0400, Bob Walton wrote: > The fminsearch.m function in the Optim-1.0.12 package is clearly > designed to implement functionality substantially identical with > Matlab's fminsearch function. Probably right. > But Matlab's fminsearch does not have the > "grad" argument -- I think it is a holdover from an ancient version of > Matlab when it was called "fmins". Also probably right. > I suggest that argument be removed. But the 'options' argument is also used in a different way. If you want compatibilty, this argument should be treated as in Matlabs version of fminsearch (optimset, optimget) and iterfaced to the variable 'stopit' in fmins.m (and 'grad' and 'varargin' removed). Olaf > A diff -c file with proposed changes is attached. > -- > Bob Walton > *** fminsearchorig.m Thu Mar 25 13:57:50 2010 > --- fminsearch.m Thu Aug 26 12:52:00 2010 > *************** > *** 21,31 **** > ## @seealso{fmin,fmins,nmsmax} > ## @end deftypefn > > ! function [x fval] = fminsearch(funfun, X0, options, grad, varargin) > ! if (nargin == 0); usage('[x fval] = fminsearch(funfun, X0, options, grad, varargin)'); end > if (nargin < 3); options=[]; end > ! if (nargin < 4); grad=[]; end > ! if (nargin < 5); varargin={}; end > x = fmins(funfun, X0, options, grad, varargin{:}); > fval = feval(funfun, x, varargin{:}); > endfunction; > --- 21,31 ---- > ## @seealso{fmin,fmins,nmsmax} > ## @end deftypefn > > ! function [x fval] = fminsearch(funfun, X0, options, varargin) > ! if (nargin == 0); usage('[x fval] = fminsearch(funfun, X0, options, varargin)'); end > if (nargin < 3); options=[]; end > ! if (nargin < 4); varargin={}; end > ! grad=[]; > x = fmins(funfun, X0, options, grad, varargin{:}); > fval = feval(funfun, x, varargin{:}); > endfunction; > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Octave-dev mailing list > Oct...@li... > https://lists.sourceforge.net/lists/listinfo/octave-dev |