Skip to contents

Solvers for NonlinearProblem()s and NonlinearLeastSquaresProblem()s with bounds lb <= u <= ub, as in NonlinearSolveFirstOrder. The initial guess must satisfy the bounds.

Usage

TrustRegionReflective(
  autodiff = NULL,
  jvp_autodiff = NULL,
  vjp_autodiff = NULL,
  linsolve = NULL,
  concrete_jac = NULL,
  gtol = NULL,
  initial_trust_radius = 1,
  max_trust_radius = Inf
)

BoundedLevenbergMarquardt(
  autodiff = NULL,
  jvp_autodiff = NULL,
  vjp_autodiff = NULL,
  linsolve = NULL,
  concrete_jac = NULL,
  gtol = NULL,
  damping = 0.001,
  max_backtracks = 40L
)

Dogbox(
  autodiff = NULL,
  jvp_autodiff = NULL,
  vjp_autodiff = NULL,
  linsolve = NULL,
  concrete_jac = NULL,
  gtol = NULL,
  initial_trust_radius = 1,
  max_trust_radius = Inf
)

BoundedGaussNewton(
  globalization = "linesearch",
  autodiff = NULL,
  jvp_autodiff = NULL,
  vjp_autodiff = NULL,
  linsolve = NULL,
  concrete_jac = NULL,
  gtol = NULL,
  initial_trust_radius = 1,
  max_trust_radius = Inf,
  max_backtracks = 40L
)

BoundedTrustRegion(
  concrete_jac = NULL,
  linsolve = NULL,
  max_trust_radius = 0,
  initial_trust_radius = 0,
  step_threshold = 1e-04,
  shrink_threshold = 1/4,
  expand_threshold = 3/4,
  shrink_factor = 1/4,
  expand_factor = 2,
  max_shrink_times = 32L,
  gtol = NULL,
  autodiff = NULL,
  vjp_autodiff = NULL,
  jvp_autodiff = NULL,
  jacobian_reuse = NULL
)

Arguments

autodiff

An ADType (see AutoFiniteDiff()), or NULL.

jvp_autodiff, vjp_autodiff, linsolve, concrete_jac

Options of the Julia signatures; the linear least squares problems are solved by QR.

gtol

Tolerance of the projected gradient test.

initial_trust_radius, max_trust_radius

Trust radius settings.

damping

Initial relative damping of BoundedLevenbergMarquardt().

max_backtracks

Largest number of trial points of each line search.

globalization

"linesearch", "trustregion" or "trustregion_linesearch".

step_threshold, shrink_threshold, expand_threshold, shrink_factor, expand_factor, max_shrink_times

Settings of the trust region of BoundedTrustRegion() (a radius of 0 selects the default).

jacobian_reuse

The Jacobian reuse policy of BoundedTrustRegion(): NULL (reuse for problems with at least 16 unknowns), a logical, or a JacobianReuse() object.

Value

An algorithm object.

Details

  • TrustRegionReflective() is the interior reflective trust region method of Coleman and Li: the iterates stay strictly inside the box (a start on a bound is moved inside), the model uses distance to bound scaling, and each step is the best of a scaled trust region step, its reflection at the first bound it hits and a scaled gradient step.

  • BoundedLevenbergMarquardt(damping, max_backtracks) solves the regularized Gauss Newton model over the box with an active set method and globalizes with a projected Armijo search, falling back to the projected gradient.

  • Dogbox() follows the dogleg path from a constrained Cauchy point to the Gauss Newton step inside the intersection of the box and an infinity norm trust region.

  • BoundedGaussNewton(globalization) is the active set Gauss Newton method with a projected line search ("linesearch"), a spherical trust region with a projected Cauchy safeguard ("trustregion") or both ("trustregion_linesearch").

  • BoundedTrustRegion() compares a projected dogleg step with a feasible projected Cauchy step and keeps the one with the larger predicted reduction.

A stationary point that is not a root ends a NonlinearProblem with "Stalled"; for least squares problems the projected gradient test with gtol (default sqrt(eps)) ends the solve with "Success". The default termination of the first four methods is AbsNormTerminationMode with the 2-norm. With autodiff = AutoFiniteDiff() and no Jacobian the Jacobian is the bound aware finite difference of NonlinearSolve, which never steps outside the box; otherwise the problem's Jacobian or central differences are used. sol$stats holds nf, njacs, nfactors, nsolve and nsteps.

Examples

f <- function(u, p) c(10 * (u[2] - u[1] * u[1]), 1 - u[1])
prob <- NonlinearProblem(f, u0 = c(-1.2, 1), lb = c(-2, -2), ub = c(2, 2))
solve(prob, TrustRegionReflective())$u
#> [1] 1 1
solve(prob, BoundedGaussNewton())$u
#> [1] 1 1
sol <- solve(prob, Dogbox())
sol$stats$nf
#> [1] 17