Configurable options

There are several options that simply take on some default values if the user doesn't supply anything else than a function (and gradient) and a starting point.

Solver options

There quite a few different solvers available in Optim, and they are all listed below. Notice that the constructors are written without input here, but they generally take keywords to tweak the way they work. See the pages describing each solver for more detail.

Requires only a function handle:

Requires a function and gradient (will be approximated if omitted):

Requires a function, a gradient, and a Hessian (cannot be omitted):

Box constrained minimization:

Special methods for bounded univariate optimization:

General Options

In addition to the solver, you can alter the behavior of the Optim package by using the following keywords:

We currently recommend the statically dispatched interface by using the Optim.Options constructor:

res = optimize(f, g!,
               [0.0, 0.0],
               GradientDescent(),
               Optim.Options(g_tol = 1e-12,
                             iterations = 10,
                             store_trace = true,
                             show_trace = false))

Another interface is also available, based directly on keywords:

res = optimize(f, g!,
               [0.0, 0.0],
               method = GradientDescent(),
               g_tol = 1e-12,
               iterations = 10,
               store_trace = true,
               show_trace = false)

Notice the need to specify the method using a keyword if this syntax is used. This approach might be deprecated in the future, and as a result we recommend writing code that has to maintained using the Optim.Options approach.