help-octave
[Top][All Lists]

## downhill simplex

 From: etienne grossmann Subject: downhill simplex Date: Sat, 14 Aug 1999 16:43:15 +0100 (WEST)

```  Hello

I wrote flexible downhill-simplex (Nelder-Mead) function. Would
anyone be interested in something like :

# Find minimum of single-variable function f1
[x0,v,neval] = downsimplex('f1',initial_simplex) ;

(the downhill-simplex method in dimension N is started from a
simplex whith N+1 vertices).

# Try guessing the initial simplex from a single vertex.
[x0,v,neval] = downsimplex('auto','f1',initial_vertex) ;

# Optimize over first arg
[x0,v,neval] = downsimplex('auto','f2',v1,v2,v3) ;

# Optimize over second arg
[x0,v,neval] = downsimplex('auto','nmin',2,'f2',v1,v2,v3) ;

and other options (more details below). Any suggestions, advice are
welcome.

Cheers,

More in detail :

##        [x0,v,niter] = downsimplex([options],func,args,...)
##
## Returned values :
##
## x0    : MxN  the found minimum of 'func'.
## v     : 1x1  the value of func( x0, all_va_args )
## niter : 1x1  the number of function evaluations.
##
## Arguments :
##
## func  : the name of the function to minimize
##
## args  : the arguments of func. The function will be minimized over
##         the nmin'th argument.
##
##         The initial simplex may be provided either thru the option
##         or the arguments :
##
##         If no initial simplex or vertex is given in the options,
##
##          if the nmin'th argument, 'x' has size (N+1)*M-by-N
##               for some M and N, it is assumed that this is the
##               initial simplex : x(1:M,:) is the first vertex,
##               x(M+1:2*M,:) the second ... x(N*M+1:(N+1)*M,:) the
##               last.
##
##          else, one of the vertices will be the nmin'th argument,
##               'x' (of size MxN). The N*M other vertices are at
##               distance 1 of x, along the canonical axes.
##
## Options :
##
## 'nmin', n     : The number of the minimized argument. Default is 1.
##
## 'init', init  : Initial simplex or vertex.
##
## 'yinit',yinit : Initial value of the function at the vertices.
##
## 'tol', tol    : stop minimizing when the current simplex has :
##                 |f(best) - f(worst)|
##                 --------------------   < tol
##                 |f(best)|+|f(worst)|
##
##                 Warning : This will fail if f(best) == 0.
##
## 'ftol', ftol  : stop minimizing when all vertices of the current simplex
##                 are less than ftol away from the best vertex. The distance
##                 of the 2-normis used. This is the default stopping
##                 criterion, with ftol==1e-6. See below for choosing a
##                 metric.
##
## 'metric', m   : specify the matrix of the metric used for computing
##                 the distance between vertices. If m is a vector, diag(m)
##                 is used. m is 'symmetrized' by taking m = (m+m')/2. The
##                 default is eye(M*N) ;
##
## 'maxeval',e   : The maximum number of function evaluations. A
##                 negative value means 'no limit'. Default is 50000.
##
## 'auto'        : Assume that a vertex has been passed, not a
##                 simplex. This is needed to allow  arguments of size
##                 M*(N+1)-by-N not to be mistaken for a simplex. If
##                 you don't know in advance what size your args will
##                 be and you want to use automatically generated
##                 initial simplexes, throw in this option.
##
## 'report',n    : Show a short report every (approximately) n
##                 evaluations. 0 (default) means never.
##
## 'verbose'     : Produce a little message at end
##
## 'debug',debug : Pass a struct 'debug'. At some points in the
##                 function, some internal variables are checked
##                 against the corresponding key of debug. If they
##                 mismatch, a message is printed and a call to
##                 keyboard is made. Recognized keys are :
##                   M,N,x,tol,ftol,metric,func
##                 See the code for more info.
##
## 'func',func   : This must be the last option. The following
##                 arguments are 'func', and its arguments. This is
##                 needed to minimize a function called e.g. 'init' or
##                 'tol'.
##
##  WARNING : If you mispell an option, downsimplex will think it is
##            the name of the minimized function.
##
##            Downsimplex defines global variables arg1,..,argP (P is
##            the number of variables that 'func' takes). These
##            variables are cleared before returning.
##
##            Downsimplex defines a function 'dummy_ds_func', which is
##            cleared before returning.

---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------

```

reply via email to