nlm_track {trackopt} | R Documentation |
Track numerical optimization
Description
-
nlm_track()
: tracknlm
iterations -
optim_track()
: trackoptim
iterations -
summary()
: summary of optimization track -
autoplot()
: visualization of optimization for one or two parameters
Usage
nlm_track(
f,
p,
target = NULL,
npar = NULL,
gradient = NULL,
hessian = NULL,
...,
iterations_max = 100,
tolerance = 1e-06,
typsize = rep(1, length(p)),
fscale = 1,
ndigit = 12,
stepmax = max(1000 * sqrt(sum((p/typsize)^2)), 1000),
steptol = 1e-06,
minimize = TRUE,
verbose = FALSE
)
optim_track(
f,
p,
target = NULL,
npar = NULL,
gradient = NULL,
...,
iterations_max = 100,
tolerance = 1e-06,
lower = NULL,
upper = NULL,
method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN", "Brent"),
control = list(),
minimize = TRUE,
verbose = FALSE
)
## S3 method for class 'trackopt'
summary(object, ...)
## S3 method for class 'trackopt'
autoplot(object, iteration = NULL, xlim = NULL, xlim2 = NULL, ...)
Arguments
f |
[ The first argument of If |
p |
[ |
target |
[ This can only be Can be |
npar |
[ Must be specified if more than two target arguments are specified via
the Can be |
gradient |
[ The function call of |
hessian |
[ The function call of |
... |
Additional arguments to be passed to |
iterations_max |
[ |
tolerance |
[ |
typsize , fscale , ndigit , stepmax , steptol |
Arguments passed on to |
minimize |
[ |
verbose |
[ |
lower , upper |
[ |
method , control |
Arguments passed on to Elements |
object |
[ |
iteration |
[ If This option is useful for creating animations, see https://bookdown.org/yihui/rmarkdown-cookbook/animation.html#ref-R-animation. |
xlim , xlim2 |
[ If |
Value
A tibble
with iterations in rows.
Examples
himmelblau <- function(x) (x[1]^2 + x[2] - 11)^2 + (x[1] + x[2]^2 - 7)^2
track <- nlm_track(f = himmelblau, p = c(0, 0))
summary(track)
ggplot2::autoplot(track)