% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dd_utils.R
\name{optimizer}
\alias{optimizer}
\title{Carries out optimization (finding a maximum)}
\usage{
optimizer(
  optimmethod = "simplex",
  optimpars = c(1e-04, 1e-04, 1e-06, 1000),
  num_cycles = 1,
  fun,
  trparsopt,
  jitter = 0,
  ...
)
}
\arguments{
\item{optimmethod}{The method to use for optimization. There is a choice of:
'simplex', which is a simplex algorithm that shows (when verbose > 0) the
optimization trajectory.
'subplex', from the package with the same name
'DEoptim', from the package with the same name
'pso', from the package with the same name
'optim::name_of_algorithm', the algorithm from the optim package (e.g.
"Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN", or "Brent")}

\item{optimpars}{Parameters of the optimization: 1) relative tolerance in
function arguments, 2) relative tolerance in function value, 3) absolute 
tolerance in function arguments as well as the function value, 4) 
maximum number of iterations and 5) TRUE/FALSE flag to allow verbose output
when using the simplex method, default is TRUE}

\item{num_cycles}{Number of cycles of the optimization. When set to Inf, the
optimization will be repeated until the result is, within the tolerance,
equal to the starting values, with a maximum of 10 cycles.}

\item{fun}{Function to be optimized}

\item{trparsopt}{Initial guess of the parameters to be optimized}

\item{jitter}{Perturbation of an initial parameter value when precisely equal
to 0.5; this is only relevant when subplex is chosen. The default value is 
0, so no jitter is applied. A recommended value when using it is 1E-5.}

\item{...}{Any other arguments of the function to be optimimized, or settings
of the optimization routine}
}
\value{
\item{out}{ A list containing optimal function arguments
(\code{par}, the optimal function value (\code{fvalues}) and whether the
optimization converged (\code{conv})}.
}
\description{
A wrapper to use several optimization routines
}
\examples{

cat("No examples")

}
\author{
Rampal S. Etienne
}
\keyword{models}
