Truncated Newton methods, also called Newton-iterative methods, solve an approximating Newton system using a conjugate-gradient approach and are related to limited-memory BFGS.
tnewton(
x0,
fn,
gr = NULL,
lower = NULL,
upper = NULL,
precond = TRUE,
restart = TRUE,
nl.info = FALSE,
control = list(),
...
)
starting point for searching the optimum.
objective function that is to be minimized.
gradient of function fn
; will be calculated numerically if
not specified.
lower and upper bound constraints.
logical; preset L-BFGS with steepest descent.
logical; restarting L-BFGS with steepest descent.
logical; shall the original NLopt info been shown.
list of options, see nl.opts
for help.
additional arguments passed to the function.
List with components:
the optimal solution found so far.
the function value corresponding to par
.
number of (outer) iterations, see maxeval
.
integer code indicating successful completion (> 1) or a possible error number (< 0).
character string produced by NLopt and giving additional information.
Truncated Newton methods are based on approximating the objective with a quadratic function and applying an iterative scheme such as the linear conjugate-gradient algorithm.
Less reliable than Newton's method, but can handle very large problems.
R. S. Dembo and T. Steihaug, “Truncated Newton algorithms for large-scale optimization,” Math. Programming 26, p. 190-212 (1982).
flb <- function(x) {
p <- length(x)
sum(c(1, rep(4, p - 1)) * (x - c(1, x[-p]) ^ 2) ^ 2)
}
# 25-dimensional box constrained: par[24] is *not* at boundary
S <- tnewton(rep(3, 25L), flb, lower = rep(2, 25L), upper = rep(4, 25L),
nl.info = TRUE, control = list(xtol_rel = 1e-8))
#>
#> Call:
#> nloptr(x0 = x0, eval_f = fn, eval_grad_f = gr, lb = lower, ub = upper,
#> opts = opts)
#>
#>
#> Minimization using NLopt version 2.7.1
#>
#> NLopt solver status: 1 ( NLOPT_SUCCESS: Generic success return value. )
#>
#> Number of Iterations....: 17
#> Termination conditions: stopval: -Inf xtol_rel: 1e-08 maxeval: 1000 ftol_rel: 0 ftol_abs: 0
#> Number of inequality constraints: 0
#> Number of equality constraints: 0
#> Optimal value of objective function: 368.105912874334
#> Optimal value of controls: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2.109093 4
#>
#>
## Optimal value of objective function: 368.105912874334
## Optimal value of controls: 2 ... 2 2.109093 4