comparison scripts/optimization/fminunc.m @ 14895:e0525ecf156e

Add new function fminsearch.m * fminsearch.m: new function. * optimization/module.mk: Add fminsearch to build system. * NEWS: Add fminsearch to list of new functions in 3.8.0. * nonlin.txi, fminbnd.m, fminunc.m: Add fminsearch to documentation. Update other optimization functions to reference fminsearch.
author Andy Adler <andy@analyti.ca>
date Fri, 20 Jul 2012 09:25:37 -0700
parents 5d3a684236b0
children bc924baa2c4e
comparison
equal deleted inserted replaced
14893:55d0f8d70fe9 14895:e0525ecf156e
22 ## @deftypefn {Function File} {} fminunc (@var{fcn}, @var{x0}) 22 ## @deftypefn {Function File} {} fminunc (@var{fcn}, @var{x0})
23 ## @deftypefnx {Function File} {} fminunc (@var{fcn}, @var{x0}, @var{options}) 23 ## @deftypefnx {Function File} {} fminunc (@var{fcn}, @var{x0}, @var{options})
24 ## @deftypefnx {Function File} {[@var{x}, @var{fvec}, @var{info}, @var{output}, @var{grad}, @var{hess}] =} fminunc (@var{fcn}, @dots{}) 24 ## @deftypefnx {Function File} {[@var{x}, @var{fvec}, @var{info}, @var{output}, @var{grad}, @var{hess}] =} fminunc (@var{fcn}, @dots{})
25 ## Solve an unconstrained optimization problem defined by the function 25 ## Solve an unconstrained optimization problem defined by the function
26 ## @var{fcn}. 26 ## @var{fcn}.
27 ##
27 ## @var{fcn} should accepts a vector (array) defining the unknown variables, 28 ## @var{fcn} should accepts a vector (array) defining the unknown variables,
28 ## and return the objective function value, optionally with gradient. 29 ## and return the objective function value, optionally with gradient.
29 ## In other words, this function attempts to determine a vector @var{x} such 30 ## In other words, this function attempts to determine a vector @var{x} such
30 ## that @code{@var{fcn} (@var{x})} is a local minimum. 31 ## that @code{@var{fcn} (@var{x})} is a local minimum.
31 ## @var{x0} determines a starting guess. The shape of @var{x0} is preserved 32 ## @var{x0} determines a starting guess. The shape of @var{x0} is preserved
70 ## 71 ##
71 ## Optionally, fminunc can also yield a structure with convergence statistics 72 ## Optionally, fminunc can also yield a structure with convergence statistics
72 ## (@var{output}), the output gradient (@var{grad}) and approximate Hessian 73 ## (@var{output}), the output gradient (@var{grad}) and approximate Hessian
73 ## (@var{hess}). 74 ## (@var{hess}).
74 ## 75 ##
75 ## Note: If you only have a single nonlinear equation of one variable, using 76 ## Notes: If you only have a single nonlinear equation of one variable then
76 ## @code{fminbnd} is usually a much better idea. 77 ## using @code{fminbnd} is usually a much better idea. The algorithm used is a
77 ## @seealso{fminbnd, optimset} 78 ## gradient search which depends on the objective function being differentiable.
79 ## If the function has discontinuities it may be better to use a derivative-free
80 ## algorithm such as @code{fminsearch}.
81 ## @seealso{fminbnd, fminsearch, optimset}
78 ## @end deftypefn 82 ## @end deftypefn
79 83
80 ## PKG_ADD: ## Discard result to avoid polluting workspace with ans at startup. 84 ## PKG_ADD: ## Discard result to avoid polluting workspace with ans at startup.
81 ## PKG_ADD: [~] = __all_opts__ ("fminunc"); 85 ## PKG_ADD: [~] = __all_opts__ ("fminunc");
82 86