optim.NM: NM optimization

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

View source: R/optim_NM.R

Description

Nelder-Mead derivative free optimization. Since it is derivative free have slow convergence.

Usage

1
2
3
optim.NM(objfnc, data, start = getInitial(objfnc, data), delta = NULL,deltar=.1, 
control=nlr.control(tolerance=1e-4, 
maxiter=250 * length(start)), ...)

Arguments

objfnc

any objective function for minimizing, it must contains accept formula, data and start as argument, extra argument can be passed by (...). The output of objfnc must be a list contains: $value(attr,gradient,hessian), $angmat (angular matrix),$angvec (angular vector) to check convergence. Usually it might have nl.form object as entry.

data

list of the data, that might have predictor and response variables with names.

deltar

=0.1. Ratio of delta value. "nlr" compute the increament interval of golden section by start +- delta, the delta by default computed by deltar*start. The user can give direct value for deltar or value of delta to be unequally ratio movement.

start

list of initial values with names as parameters.

delta

vector with same size of parameters named as parameter names, is increament for each parameter at the begining. Each parameter will be moved by delta.

control

nlr.control options to control the optimization iterations.

...

any external parameters passe to objfnc.

Details

Optimize objective function objfnc with respect to parameters start. The mothod is derivative free using Nelder-Mead method.

The function smptry Find next minimum point in Nelder-Mead algorithm. It used for internal usage might not be called by user directly.

Value

result is a list of:

parameters

list of estimated parameters wit hsame names as start

objfnc

computed object function returned back by objfnc

history

history of fitt, include parameters and objective values, other level of iteration is presented for which in each iteration some more steps is done to rectify the singularity of hessian.

Note

User can define his own optimization function objfnc for any purpose, but this function designed eficiently for robust estimates. It is applied for minimizing several kind of objective functions such as heteroscedastic, chi-square likelihood, robust loss, but for other general problem usage is not tested. Since Nelder-Mead is derivative free its convergence is slow, so it is suggested to use more maximum number of iteration option in nlr.control. optim.NLM is more efficient method use derivative values, but when the derivative does not exist nelder-Mead can be used.

This function call by nlr, for compatibility it is better to call from nlr rather than directly by user. User can use it for optimization purposes.

Author(s)

Hossein Riazoshams, May 2014. Email: riazihosein@gmail.com URL http://www.riazoshams.com/nlr/

References

Rizo ML 2008 Statistical Computing with R The R Series. Chapman & Hall/CRC The R Series.

See Also

nlr.control, nl.form, optim.NLM

Examples

1
2
3
4
5
6
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
"optim.NM"

nlr documentation built on July 31, 2019, 5:09 p.m.

Related to optim.NM in nlr...