Issue of passing an argument to the objective function that is NULL, for example the following leads to the error message "Error: Function evaluation threw an error: argument "ind" is missing, with no default".
stopifnot(packageVersion("ao") == "0.3.1", packageVersion("optimizeR") == "1.0.3")
f <- function(x, a, b, ind) {
if (is.null(ind)) {
(x[1]^2 + x[2] + a)^2 + (x[1] + x[2]^2 + b)^2 + (x[3] - 1)^2
}
}
base_optimizer <- optimizeR::optimizer_nlm()
a <- -11
b <- -7
partition <- list(1, 2:3)
ao::ao(
f = f,
p = c(0, 0, 0),
a = a,
b = b,
ind = NULL,
partition = partition,
base_optimizer = optimizeR::optimizer_nlm(),
iterations = 10,
tolerance = 1e-06,
verbose = TRUE
)
Issue of passing an argument to the objective function that is
NULL
, for example the following leads to the error message "Error: Function evaluation threw an error: argument "ind" is missing, with no default".