acp: Optimization using an iterative hill-climbing algorithm

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Box-constrained optimization using an iterative hill-climbing algorithm

Usage

1
acp(start, objective, ..., control = list(), lower, upper)

Arguments

start

Initial staring values for the parameters to be optimized

objective

A function to be minimized. The fist argument to the function should be the vector of parameters to be optimized. The function should return a scalar value.

...

Further arguments to be supplied to objective.

control

A list of control parameters. See 'Details' for more information.

lower, upper

Vectors, replicated to be as long as start. Lower and upper bounds of the parameter space.

Details

The control argument is a list that can supply any of the following components:

trace

logical. If true, tracing information on the progress of the optimization is produced.

maxit

The maximum number of iterations. Defaults to 1000

lmax

The number of stepping cycles per iteration. Defaults to 20

strict

logical. If TRUE, iteration continues until all the values of stepsize are less than the value of abs.tol. Defaults to FALSE

abs.tol

The absolute convergence tolerance. Defaults to .Machine$double.eps. Relevant only when strict=TURE

auto.correct

logical indicating wheather to adjust the starting value with warning when value is equal to upper or lower bound (which may lead to convergence error). Defaults to TRUE

Value

A list containing:

par

The best set of parameters found through iterative searching.

convergence

An integer indicating success or possible error. 0 indicates successful completion.

iterations

The number of iterations took took to converge.

value

The value of objective with par.

trace

If argument control(trace=TRUE), a dataframe containing the values and pars at each iteration is returened. Otherwise, NULL

Author(s)

R port: Kazunaga Matsuki

original Fortran code by Unknown

References

Chandler, J.P. (1969). Subroutine STEPIT – finds local minimum of a smooth function of several parameters. Behavioral Science, 14, 81-82.

Judd, C. M., & McClelland, G. H. (1989). Data analysis: A model-comparison approach. San Diego: Harcourt Brace Jovanovich.

See Also

optim, nlm, nlminb

Examples

1
2
3
4
5
6
7
8
9
## example taken from nlmimb
x <- rnbinom(100, mu = 10, size = 10)
hdev <- function(par)
    -sum(dnbinom(x, mu = par[1], size = par[2], log = TRUE))
    
nlminb(c(20, 20), hdev, lower = 0.001, upper = Inf) 

## acp produce comparable results
acp(c(20, 20), hdev, lower = 0.001, upper = Inf) 

matsukik/mrsat documentation built on May 21, 2019, 12:57 p.m.