Learn R Programming

bossMaps (version 0.1.0)

optifix: optifix. Optimise with some fixed parameters

Description

Like optim, but with option to fix some parameters.

Usage

optifix(parms, fixed, fn, gr = NULL, ..., method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN"), lower = -Inf, upper = Inf, control = list(), hessian = FALSE)

Arguments

parms
Parameters to potentially optimize in fn
fixed
A vector of TRUE/FALSE values indicating which parameters in parms to hold constant (not optimize). If TRUE, the corresponding parameter in fn() is fixed. Otherwise it's variable and optimised over.
fn
Function to optimize (same as in optim)
gr
Gradient function (same as in optim)
...
Further arguments to be passed to fn and gr.
method
Method to use for optimization (same as in optim)
lower
Lower limits (same as in optim)
upper
Upper limits (same as in optim)
control
Control list (same as in optim)
hessian
Return Hessian object (same as in optim)

Value

Similar to optim but adds a vector of all the parameters and a vector copy of the 'fixed' argument.

Details

Originally written by Barry Rowlingson"

References

http://www.maths.lancs.ac.uk/~rowlings/R/Optifix/optifix.R