optifix: Fixed parameter optimisation

Description Usage Arguments Value See Also Examples

View source: R/optifix.R

Description

Optifix is a function originally written by Barry Rowlingson (b.rowlingsno at lancaster.ac.uk) that acts as a wrapper for the optim function, allowing the user to fix any specified parameters during optimisation.

Usage

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

Arguments

par

a vector of the parameters to be optimised

fixed

a vector of boolean values corresponding to the values of par. If the corresponding index is TRUE, then the parameter in par will be fixed during optimisation.

fn

the cost function to be optimised over, as in optim

gr

as in optim

Value

returns as with optim, but with a few extra variables to summarise the fixed parameters

See Also

optim

Examples

1
fit <- optifix(c(1,1),c(TRUE,FALSE),cost_function,data=example_data)

jameshay218/mcmcJH documentation built on May 18, 2019, 11:20 a.m.