Learn R Programming

optextras (version 2013-10.27)

axsearch: Perform axial search around a supposed minimum and provide diagnostics

Description

Nonlinear optimization problems often terminate at points in the parameter space that are not satisfactory optima. This routine conducts an axial search, stepping forward and backward along each parameter and computing the objective function. This allows us to compute the tilt and radius of curvature or roc along that parameter axis.

axsearch assumes that one is MINIMIZING the function fn. While we believe that it will work using the wrapper ufn from this package with the 'maximize=TRUE' setting, we believe it is much safer to write your own function that is to be minimized. That is minimize (-1)*(function to be maximized). All discussion here is in terms of minimization.

Axial search may find parameters with a function value lower than that at the supposed minimum, i.e., lower than fmin.

In this case axsearch exits immediately with the new function value and parameters. This can be used to restart an optimizer, as in the optimx wrapper.

Usage

axsearch(par, fn=NULL, fmin=NULL, lower=NULL, upper=NULL, bdmsk=NULL, trace=0, ...)

Arguments

par
A numeric vector of values of the optimization function parameters that are at a supposed minimum.
fn
The user objective function
fmin
The value of the objective function at the parameters par. ?? what if fmin==NULL?
lower
A vector of lower bounds on the parameters.
upper
A vector of upper bounds on the parameters.
bdmsk
An indicator vector, having 1 for each parameter that is "free" or unconstrained, and 0 for any parameter that is fixed or MASKED for the duration of the optimization. Partly for historical reasons, we use the same array during the progres
trace
If trace>0, then local output is enabled.
...
Extra arguments for the user function.

Value

  • A list with components:
  • bestfnThe lowest (best) function value found (??maximize??) during the axial search, else the original fmin value. (This is actively set in that case.)
  • parThe vector of parameters at the best function value.
  • detailsA data frame reporting the original parameters, the forward step and backward step function values, the size of the step taken for a particular parameter, the tilt and the roc (radius of curvature). Some elements will be NA if we find a lower function value during the axial search.

encoding

UTF-8

Details

None.

Examples

Run this code
#####################

Run the code above in your browser using DataLab