These functions support the S3 class 'optimsimplex' and are intended to either create objects of this class or check if an object is of this class.
optimsimplex(coords = NULL, fun = NULL, data = NULL, method = NULL,
x0 = NULL, len = NULL, deltausual = NULL, deltazero = NULL,
boundsmax = NULL, boundsmin = NULL, nbve = NULL,
simplex0 = NULL)
optimsimplex.tostring(x)
# S3 method for optimsimplex
print(x,...)
# S3 method for optimsimplex
is(x)
The matrix of point estimate coordinates in the simplex. The
coords matrix is expected to be a nbve x n matrix, where n is the dimension
of the space and nbve is the number of vertices in the simplex, with nbve>=
n+1. Only used if method
is set to NULL.
The function to compute at vertices. The function is expected to have the following input and output arguments:
myfunction <- function(x, this){ |
... |
return(list(f=f,this=this)) |
where x is a row vector and this a user-defined data, i.e. the data
argument.
A user-defined data passed to the function. If data is provided,
it is passed to the callback function both as an input and output argument.
data
may be used if the function uses some additionnal parameters. It
is returned as an output parameter because the function may modify the data
while computing the function value. This feature may be used, for example,
to count the number of times that the function has been called.
The method used to create the new optimsimplex object, either 'axes', 'pfeffer', 'randbounds', 'spendley' or 'oriented'.
The initial point estimates, as a row vector of length n.
The dimension of the simplex. If length is a value, that unique
length is used in all directions. If length is a vector with n values, each
length is used with the corresponding direction. Only used if method
is set to 'axes' or 'spendley'.
The absolute delta for non-zero values. Only used if
method
is set to 'pfeffer'.
The absolute delta for zero values. Only used if
method
is set to 'pfeffer'.
A vector of minimum bounds. Only used if method
is
set to 'randbounds'.
A vector of maximum bounds. Only used if method
is
set to 'randbounds'.
The total number of vertices in the simplex. Only used if
method
is set to 'randbounds'.
The initial simplex. Only used if method
is set to
'oriented'.
An object of class 'optimsimplex'.
optional arguments to 'print' or 'plot' methods.
The optimsimplex
function returns a list with the following elements:
An object of class 'simplex', i.e. a list with the following elements:
The verbose option, controlling the amount of messages. Set to FALSE.
The coordinates of the vertices, with size nbve x n.
The dimension of the space.
The values of the function at given vertices. It is a column matrix of length nbve.
The number of vertices.
The updated data
input argument.
All arguments of optimsimplex
are optional. If no input is provided,
the new optimsimplex object is empty.
If method
is NULL, the new optimsimplex object is created by
optimsimplex.coords
. If coords
is NULL, the optimsimplex object
is empty; otherwise, coords
is used as the initial vertice coordinates
in the new simplex.
If method
is set to 'axes', the initial vertice coordinates are stored
in a nbve x n matrix built as follows:
[,1] | | | x0[1] | .... | x0[n] | | | | | len[1] | ... | 0 | | | |
[,.] | | | ... | ... | ... | | | + | | | ... | ... | ... | | |
[,nbve] | | | x0[1] | ... | x0[n] | | | | | 0 | ... | len[n] | | |
If method
is set to 'pfeffer', the new optimsimplex object is created
using the Pfeffer's method, i.e. a relative delta for non-zero values and an
absolute delta for zero values.
If method
is set to 'randbounds', the initial vertice coordinates are
stored in a nbve x n matrix consisting of the initial point estimates (on the
first row) and a (nbve-1) x n matrix of randomly sampled numbers between the
specified the bounds. The number of vertices nbve
in the optimsimplex
is arbitrary.
If method
is set to 'spendley', the new optimsimplex object is created
using the Spendely's method, i.e. a regular simplex made of nbve = n+1
vertices.
If method
is set to 'oriented', the new optimsimplex object is created
in sorted order. The new simplex has the same sigma- length of the base
simplex, but is "oriented" depending on the function value. The created
optimsimplex may be used, as Kelley suggests, for a restart of Nelder-Mead
algorithm.
The optimsimplex.tostring
function is a utility function, which formats
the content of a optimsimplex object into a single string of characters.
"A Simplex Method for Function Minimization", Nelder, J. A. and Mead, R. The Computer Journal, January, 1965, 308-313
"Sequential Application of Simplex Designs in Optimisation and Evolutionary Operation", W. Spendley, G. R. Hext, F. R. Himsworth, Technometrics, Vol. 4, No. 4 (Nov., 1962), pp. 441-461, Section 3.1
"A New Method of Constrained Optimization and a Comparison With Other Methods", M. J. Box, The Computer Journal 1965 8(1):42-52, 1965 by British Computer Society
"Detection and Remediation of Stagnation in the Nelder-Mead Algorithm Using a Sufficient Decrease Condition", SIAM J. on Optimization, Kelley C.T., 1999
"Multi-Directional Search: A Direct Search Algorithm for Parallel Machines", by E. Boyd, Kenneth W. Kennedy, Richard A. Tapia, Virginia Joanne Torczon, Virginia Joanne Torczon, 1989, Phd Thesis, Rice University
"Grid Restrained Nelder-Mead Algorithm", Arpad Burmen, Janez Puhan, Tadej Tuma, Computational Optimization and Applications, Volume 34 , Issue 3 (July 2006), Pages: 359 - 375
"A convergent variant of the Nelder-Mead algorithm", C. J. Price, I. D. Coope, D. Byatt, Journal of Optimization Theory and Applications, Volume 113 , Issue 1 (April 2002), Pages: 5 - 19,
"Global Optimization Of Lennard-Jones Atomic Clusters", Ellen Fan, Thesis, February 26, 2002, McMaster University
# NOT RUN {
myfun <- function(x,this){return(list(f=sum(x^2),this=this))}
mat <- matrix(c(0,1,0,0,0,1),ncol=2)
optimsimplex()
optimsimplex(coords=mat,x0=1:4,fun=myfun)
optimsimplex(method='axes',x0=1:4,fun=myfun)
optimsimplex(method='pfeffer',x0=1:6,fun=myfun)
opt <- optimsimplex(method='randbounds',x0=1:6,boundsmin=rep(0,6),
boundsmax=rep(10,6),fun=myfun)
opt
optimsimplex(method='spendley',x0=1:6,fun=myfun,len=10)
optimsimplex(method='oriented',simplex=opt$newobj,fun=myfun)
# }
Run the code above in your browser using DataLab