optimize | R Documentation |
This function extends the existing optimization capabilities by integrating the 'optimx' package, allowing the use of various optimization algorithms such as "L-BFGS-B", "BFGS", "Nelder-Mead", etc.
optimize(
objfn,
parinit,
method = "L-BFGS-B",
lower = -Inf,
upper = Inf,
control = list(),
...
)
objfn |
A function that computes and returns a list with components 'value', 'gradient', and 'hessian'. This represents the objective function to be minimized. |
parinit |
A numeric vector of initial parameter values. |
method |
A character string specifying the optimization method. Defaults to "L-BFGS-B". Available methods include those supported by the 'optimx' package, such as "BFGS", "Nelder-Mead", "L-BFGS-B", etc. |
lower |
A numeric vector of lower bounds for the parameters (used only by methods that support box constraints, e.g., "L-BFGS-B"). Defaults to '-Inf'. |
upper |
A numeric vector of upper bounds for the parameters (used only by methods that support box constraints, e.g., "L-BFGS-B"). Defaults to 'Inf'. |
control |
A list of control parameters to pass to the optimization algorithm. |
... |
Additional arguments to pass to the objective function. |
A list containing: - 'value': The value of the objective function at the optimum. - 'gradient': The gradient at the optimum. - 'hessian': The Hessian at the optimum. - 'argument': The optimized parameters. - 'converged': Logical indicating if the optimizer converged. - 'iterations': The number of function evaluations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.