S3 neldermead object

Share:

Description

These functions support the S3 class 'neldermead'and are intended to either create objects of this class or check if an object is of this class.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  neldermead(optbase, method, simplex0, simplex0method, 
    simplex0length, simplexsize0, simplexopt, historysimplex, coords0, rho, chi, 
    gamma, sigma, tolfstdeviation, tolfstdeviationmethod, tolsimplexizeabsolute, 
    tolsimplexizerelative, tolsimplexizemethod, toldeltafv, tolssizedeltafvmethod,
    simplex0deltausual, simplex0deltazero, restartsimplexmethod, restartmax, 
    restarteps, restartstep, restartnb, restartflag, restartdetection, 
    kelleystagnationflag, kelleynormalizationflag, kelleystagnationalpha0, 
    kelleyalpha, startupflag, boxnbpoints, boxnbpointseff, boxineqscaling, 
    checkcostfunction, scalingsimplex0, guinalphamin, boxboundsalpha, 
    boxtermination, boxtolf, boxnbmatch, boxkount, boxreflect, tolvarianceflag, 
    tolabsolutevariance, tolrelativevariance, variancesimplex0, mymethod, 
    myterminate, myterminateflag, greedy, output, exitflag)
    
  ## S3 method for class 'neldermead'
print(x,verbose,...)
  
  ## S3 method for class 'neldermead'
summary(object,showhistory,...)
  
  ## S3 method for class 'neldermead'
is(x=NULL)
  

Arguments

optbase

An object of class 'optimbase', i.e. a list created by optimbase() and containing the following elements:

verbose

The verbose option, controlling the amount of messages.

x0

The initial guess.

fx0

The value of the function for the initial guess.

xopt

The optimum parameter.

fopt

The optimum function value.

tolfunabsolute

The absolute tolerance on function value.

tolfunrelative

The relative tolerance on function value.

tolfunmethod

Logical flag for the tolerance on function value in the termination criteria. This criteria is suitable for functions which minimum is associated with a function value equal to 0.

tolxabsolute

The absolute tolerance on x.

tolxrelative

The relative tolerance on x.

tolxmethod

Possible values: FALSE, TRUE.

funevals

The number of function evaluations.

maxfunevals

The maximum number of function evaluations.

maxiter

The maximum number of iterations.

iterations

The number of iterations.

fun

The cost function.

status

The status of the optimization.

historyfopt

The vector to store the history for fopt. The values of the cost function will be stored at each iteration in a new element, so the length of historyfopt at the end of the optimization should be the number of iterations.

historyxopt

The list to store the history for xopt. The vectors of estimates will be stored on separated levels of the list, so the length of historyfopt at the end of the optimization should be the number of iterations.

verbosetermination

The verbose option for termination criteria.

outputcommand

The command called back for output.

outputcommandarg

The outputcommand argument is initialized as a string. If the user configure this element, it is expected that a matrix of values or a list is passed so that the argument is appended to the name of the function.

numberofvariables

The number of variables to optimize.

storehistory

The flag which enables/disables the storing of the history.

costfargument

The costf argument is initialized as a string. If the user configure this element, it is expected that a matrix of values or a list is passed so that the argument is appended to the name of the function.

boundsmin

Minimum bounds for the parameters.

boundsmax

Maximum bounds for the parameters.

nbineqconst

The number of nonlinear inequality constraints.

logfile

The name of the log file.

logfilehandle

The handle for the log file.

logstartup

Set to TRUE when the logging is started up.

withderivatives

Set to TRUE when the method uses derivatives.

method

The name of the algorithm to use.

simplex0

An object of class 'simplex', i.e. a list created by optimsimplex(), and containing the following elements:

verbose

The verbose option, controlling the amount of messages.

x

The coordinates of the vertices, with size nbve x n.

n

The dimension of the space.

fv

The function values, with size nbve x 1.

nbve

The number of vertices.

simplex0method

The method to use to compute the initial simplex.

simplex0length

The length to use when the initial simplex is computed with the 'axes' or 'spendley' methods.

rho

The reflection coefficient. This parameter is used when the method element is set to 'fixed' or 'variable'.

chi

The expansion coefficient. This parameter is used when the method element is set to 'variable'.

gamma

The contraction coefficient. This parameter is used when the method element is set to 'variable'.

sigma

The shrinkage coefficient. This parameter is used when the method element is set to 'fixed' or 'variable'.

tolfstdeviation

The tolerance for the standard deviation.

tolfstdeviationmethod

Set to FALSE.

tolsimplexizeabsolute

The absolute tolerance on the simplex size.

tolsimplexizerelative

The relative tolerance on the simplex size.

tolsimplexizemethod

Logical flag to enable/disable the tolerance on the simplex size. When this criteria is enabled, the values of the tolsimplexizeabsolute and tolsimplexizerelative elements are used in the termination criteria. The method to compute the size is the 'sigmaplus' method.

simplexsize0

Initial size of the simplex, for the tolerance on the simplex size.

toldeltafv

The absolute tolerance on the difference between the highest and the lowest function values.

tolssizedeltafvmethod

Logical flag to enable/disable the termination criteria based on the size of the simplex and the difference of function value in the simplex. If this criteria is triggered, the status of the optimization is set to 'tolsizedeltafv'. This termination criteria uses the values of the tolsimplexizeabsolute and toldeltafv elements. This criteria is identical to Scilab's fminsearch.

historysimplex

The list to store the history for simplex. The simplex will be stored on a new level of the list at each iteration, so the length of historyfopt at the end of the optimization should be the number of iterations.

coords0

The coordinates of the vertices of the initial simplex. If the simplex0method element is set to 'given', these coordinates are used to compute the initial simplex. This matrix is expected to have shape nbve x n where nbve is the number of vertices and n is the number of variables.

simplex0deltausual

The relative delta for non-zero parameters in 'pfeffer' method.

simplex0deltazero

The absolute delta for non-zero parameters in 'pfeffer' method.

simplexopt

The optimum simplex, after one optimization process.

restartsimplexmethod

The method to compute the initial simplex after a restart.

restartmax

The maximum number of restarts, when automatic restart is enabled via the restartflag element.

restarteps

The absolute epsilon value used to check for optimality in the factorial O'Neill restart detection.

restartstep

The absolute step length used to check for optimality in the factorial O'Neill restart detection.

kelleystagnationflag

Logical flag to enable/disable the termination criteria using Kelley's stagnation detection, based on sufficient decrease condition. If this criteria is triggered, the status of the optimization is set to 'kelleystagnation'.

,

kelleynormalizationflag

Logical flag to enable/disable the normalization of the alpha coefficient in Kelley's stagnation detection, i.e. use the value of the kelleystagnationalpha0 element as is.

kelleystagnationalpha0

The parameter used in Kelley's stagnation detection.

kelleyalpha

The current value of Kelley's alpha, after normalization, if required.

restartnb

Number of restarts performed.

restartflag

Logical flag to enable/disable the automatic restart of the algorithm.

restartdetection

The method to detect if the automatic restart must be performed.

startupflag

Set to TRUE when the startup has been performed.

boxnbpoints

The number of points in the initial simplex, when the simplex0method is set to 'randbounds'. The value of this element is also use to update the simplex when a restart is performed and the restartsimplexmethod element is set to 'randbounds'. The default value is so that the number of points is twice the number of variables of the problem.

boxnbpointseff

The effective number of points required in the simplex for Box's algorithm.

boxineqscaling

The scaling coefficient used to scale the trial point for function improvement or into the constraints of Box's algorithm.

checkcostfunction

Logical flag to enable/disable the checking of the connection of the cost function.

scalingsimplex0

The algorithm used to scale the initial simplex into the nonlinear constraints. The following two algorithms are provided:

'tox0'

scales the vertices toward the initial guess.

'tocentroid'

scales the vertices toward the centroid, as recommended by Box.

If the centroid happens to be unfeasible, because the constraints are not convex, the scaling of the initial simplex toward the centroid may fail. Since the initial guess is always feasible, scaling toward the initial guess cannot fail.

guinalphamin

The minimum value of alpha when scaling the vertices of the simplex into nonlinear constraints in Box's algorithm.

boxboundsalpha

The parameter used to project the vertices into the bounds in Box's algorithm.

boxtermination

Logical flag to enable/disable Box's termination criteria.

boxtolf

The absolute tolerance on difference of function values in the simplex, suggested by Box. This tolerance is used if the boxtermination element is set to TRUE.

boxnbmatch

The number of consecutive match of Box's termination criteria.

boxkount

Current number of consecutive match.

boxreflect

The reflection factor in Box's algorithm.

tolvarianceflag

Logical flag to enable/disable the termination criteria based on the variance of the function value. If this criteria is triggered, the status of the optimization is set to 'tolvariance'. This criteria is suggested by Nelder and Mead.

tolabsolutevariance

The absolute tolerance on the variance of the function values of the simplex.

tolrelativevariance

The relative tolerance on the variance of the function values of the simplex.

variancesimplex0

Relative tolerance on variance.

mymethod

A user-derined simplex algorithm.

myterminate

A user-defined terminate function.

myterminateflag

Logical flag to enable/disable the user-defined terminate function.

greedy

Logical flag to enable/disable greedy Nelder-Mead.

output

The command to call back for user-defined output of specialized function.

exitflag

Logical flag to enable/disable the user-defined output of specialized function.

x

An object of class 'neldermead'.

verbose

A logical flag, controlling the amount of data printed.

...

optional arguments to 'print' or 'plot' methods.

object

An object of class 'neldermead'.

showhistory

Optional logical flag, to define whether optimization history must be summarized or not.

Value

The neldermead function returns a new object of class 'neldermead', with the following default content:

optbase

An object of class 'optimbase' with the following default content:

verbose

Default is FALSE.

x0

Default is NULL.

fx0

Default is NULL.

xopt

Default is 0.

fopt

Default is 0.

tolfunabsolute

Default is 0.

tolfunrelative

Default is .Machine$double.eps.

tolfunmethod

Default is FALSE.

tolxabsolute

Default is 0.

tolxrelative

Default is .Machine$double.eps.

tolxmethod

Default is TRUE.

funevals

Default is 0.

maxfunevals

Default is 100.

maxiter

Default is 100.

iterations

Default is 0.

fun

Default is ”.

status

Default is ”.

historyfopt

Default is NULL.

historyxopt

Default is NULL.

verbosetermination

Default is FALSE.

outputcommand

Default is ”.

outputcommandarg

Default is ”. If the user configures this element, it is expected to be an object of class 'optimbase.outputargs' or will be coerced to an object of class 'optimbase.outputargs'.

numberofvariables

Default is 0.

storehistory

Default is FALSE.

costfargument

Default is ”. If the user configures this element, it is expected to be an object of class 'optimbase.functionargs' or will be coerced to an object of class 'optimbase.functionargs'.

boundsmin

Default is NULL.

boundsmax

Default is NULL.

nbineqconst

Default is 0.

logfile

Default is ”.

logfilehandle

Default is 0.

logstartup

Default is FALSE.

withderivatives

Default is FALSE.

method

Default is 'variable'.

simplex0

Default is an object of class 'simplex', with the following content:

verbose

Default is 0.

x

Default is NULL.

n

Default is 0.

fv

Default is NULL.

nbve

Default is 0.

simplex0method

Default is 'axes'.

simplex0length

Default is 1.

rho

Default is 1.

chi

Default is 2.

gamma

Default is 0.5.

sigma

Default is 0.5.

tolfstdeviation

Default is 0.

tolfstdeviationmethod

Default is FALSE.

tolsimplexizeabsolute

Default is 0.

tolsimplexizerelative

Default is .Machine$double.eps.

tolsimplexizemethod

Default is FALSE.

simplexsize0

Default is 0.

toldeltafv

Default is .Machine$double.eps.

tolssizedeltafvmethod

Default is FALSE.

historysimplex

Default is NULL.

coords0

Default is NULL.

simplex0deltausual

Default is 0.05.

simplex0deltazero

Default is 0.0075.

simplexopt

Default is NULL.

restartsimplexmethod

Default is 'oriented'.

restartmax

Default is 3.

restarteps

Default is .Machine$double.eps.

restartstep

Default is 1.

kelleystagnationflag

Default is FALSE.

,

kelleynormalizationflag

Default is TRUE, i.e. the simplex gradient of the initial simplex is taken into account in the stagnation detection.

kelleystagnationalpha0

Default is 1.e-4.

kelleyalpha

Default is 1.e-4.

restartnb

Default is 0.

restartflag

Default is FALSE.

restartdetection

Default is 'oneill'.

startupflag

Default is FALSE.

boxnbpoints

Default is '2n'.

boxnbpointseff

Default is 0.

boxineqscaling

Default is 0.

checkcostfunction

Default is TRUE.

scalingsimplex0

Default is 'tox0'.

guinalphamin

Default is 1.e-6.

boxtermination

Default is FALSE.

boxtolf

Default is 1.e-5.

boxnbmatch

Default is 5.

boxkount

Default is 0.

boxreflect

Default is 1.3.

tolvarianceflag

Default is FALSE.

tolabsolutevariance

Default is 0.

tolrelativevariance

Default is .Machine$double.eps.

variancesimplex0

Default is .Machine$double.eps.

mymethod

Default is NULL.

myterminate

Default is NULL.

myterminateflag

Default is FALSE.

greedy

Default is FALSE.

output

Default is list().

exitflag

Default is FALSE.

Author(s)

Author of Scilab neldermead module: Michael Baudin (INRIA - Digiteo)

Author of R adaptation: Sebastien Bihorel (sb.pmlab@gmail.com)

See Also

optimbase, optimsimplex