Data Mining Algorithms In R/Packages/optimsimplex/optimsimplex.new

Description
optimsimplex.new creates a simplex list object which contains, among other elements, a matrix of vertices and a vector of function values calculated at those vertices. The object is actually created by a secondary function based upon the value of the method argument:
 * NULL -> optimsimplex.coords
 * ’axes’ -> optimsimplex.axes
 * ’pfeffer’ -> optimsimplex.pfeffer
 * ’randbounds’ -> optimsimplex.randbounds
 * ’spendley’ -> optimsimplex.spendley
 * ’oriented’ -> optimsimplex.oriented

Usage
optimsimplex.new(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.coords(coords = NULL, fun = NULL, data = NULL) optimsimplex.axes(x0 = NULL, fun = NULL, len = NULL, data = NULL) optimsimplex.pfeffer(x0 = NULL, fun = NULL, deltausual = NULL, deltazero = NULL, data = NULL) optimsimplex.randbounds(x0 = NULL, fun = NULL, boundsmin = NULL, boundsmax = NULL, nbve = NULL, data = NULL) optimsimplex.spendley(x0 = NULL, fun = NULL, len = NULL, data = NULL) optimsimplex.oriented(simplex0 = NULL, fun = NULL, data = NULL)

Details
All arguments of optimsimplex.new are optional. If no input is provided, the new simplex object is empty. If method is NULL, the new simplex object is created by optimsimplex.coords. If coords is NULL, the simplex object is empty; otherwise, coords is used as the initial vertice coordinates in the new simplex. If method is set to ’axes’, the new simplex object is created by optimsimplex.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 simplex object is created by optimsimplex.pfeffer 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 new simplex object is created by optimsimplex.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 simplex is arbitrary. If method is set to ’spendley’, the new simplex object is created by optimsimplex.spendley using the Spendely’s method, i.e. a regular simplex made of nbve = n+1 vertices. If method is set to ’oriented’, the new simplex object is created by optimsimplex.oriented 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 simplex may be used, as Kelley suggests, for a restart of Nelder-Mead algorithm.

Value
Return a list with the following elements:
 * newobj A list with a ’type’ attribute set to ’T_SIMPLEX’ and with the following elements:
 * verbose The verbose option, controlling the amount of messages. Set to 0.
 * x The coordinates of the vertices, with size nbve x n.
 * n The dimension of the space.
 * fv The values of the function at given vertices. It is a column matrix of length nbve.
 * nbve The number of vertices.
 * data The updated data input argument.

Authors
Author of Scilab optimsimplex module: Michael Baudin (INRIA - Digiteo) Author of R adaptation: Sebastien Bihorel (sb.pmlab@gmail.com)

Examples
myfun <- function(x,this){return(list(f=sum(x^2),this=this))} mat <- matrix(c(0,1,0,0,0,1),ncol=2) optimsimplex.new optimsimplex.new(coords=mat,x0=1:4,fun=myfun) optimsimplex.new(method='axes',x0=1:4,fun=myfun) optimsimplex.new(method='pfeffer',x0=1:6,fun=myfun) opt <- optimsimplex.new(method='randbounds',x0=1:6,boundsmin=rep(0,6), boundsmax=rep(10,6),fun=myfun) opt optimsimplex.new(method='spendley',x0=1:6,fun=myfun,len=10) optimsimplex.new(method='oriented',simplex=opt$newobj,fun=myfun)