S3 optimbase classes

Description

These functions support the S3 class 'optimbase' and related S3 classes 'optimbase.outputargs' and 'optimbase.functionargs'. They are intended to either create objects of these classes, check if an object is of these classes, or coerce it to one of these classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  optimbase(verbose, x0, fx0, xopt, fopt, tolfunabsolute, 
    tolfunrelative, tolfunmethod, tolxabsolute, tolxrelative, tolxmethod, 
    maxfunevals, funevals, maxiter, iterations, fun, status, historyxopt,
    historyfopt, verbosetermination, outputcommand, outputcommandarg,
    numberofvariables, storehistory, costfargument, boundsmin, boundsmax,
    nbineqconst, logfile, logfilehandle, logstartup, withderivatives)
  
  optimbase.outputargs(...)
  
  optimbase.functionargs(...)
  
  ## S3 method for class 'optimbase'
print(x,verbose=FALSE,...)
  
  ## S3 method for class 'optimbase'
is(x=NULL)
  
  ## S3 method for class 'optimbase'
summary(object,showhistory,...)
  
  ## S3 method for class 'optimbase.outputargs'
is(x=NULL)
  
  ## S3 method for class 'optimbase.outputargs'
as(x=NULL)
  
  ## S3 method for class 'optimbase.functionargs'
is(x=NULL)
  
  ## S3 method for class 'optimbase.functionargs'
as(x=NULL)
  

Arguments

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.

maxfunevals

The maximum number of function evaluations.

funevals

The 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.

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.

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.

verbosetermination

The verbose option for termination criteria.

outputcommand

The command called back for output. This must be a valid R function accepting the following arguments:

state

A character string, typically indicating the status of the algorithm.

data

A list containing at least the following elements:

x

the current point estimate,

fval

the value of the cost function at the current point estimate,

iteration

the current iteration index,

funccount

the number of function evaluations.

fmsdata

An optional object of class 'optimbase.outputargs'.

outputcommandarg

The outputcommand argument is initialized as an empty object of class 'optimbase.outputargs' passed to the command defined in the outputcommand element of the optimbase object. This object has no required structure or content but is typically a list which may be used to provide some extra information to the output command.

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 an empty object of class 'optimbase.functionargs'. This object has no required structure or content but is typically a list which may be used to provide some information to the cost 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.

...

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

x

An object of class 'optimbase'.

object

An object of class 'optimbase'.

showhistory

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

Value

The optimbase function returns a new object of class 'optimbase', i.e. a list containing the following elements:

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.

maxfunevals

Default is 100.

funevals

Default is 0.

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.

The print.optimbase and is.optimbase functions are S3 method for objects of class 'optimbase'. The showhistory argument can be provided to the print.optimbase function to indicate whether or not the history of optimization should be printed.

The optimbase.outputargs function returns a new object of class 'optimbase.outputargs', i.e. a list of all arguments provided by the user. The is.optimbase.outputargs functions are S3 method for objects of class 'optimbase.outputargs'.

The optimbase.functionargs function returns a new object of class 'optimbase.functionargs', i.e. a list of all arguments provided by the user. The is.optimbase.functionargs functions are S3 method for objects of class 'optimbase.functionargs'.

Author(s)

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

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