This function is useful for testing or debugging the behavior of optimization functions. It can throw a warning and / or an error on purpose.
test_optimizer(
objective = test_objective,
initial = 1,
...,
parameter = 1,
value = objective(parameter),
seconds = 0,
warning_prob = 0,
error_prob = 0,
warning_msg = "warning",
error_msg = "error",
call. = TRUE
)A list with elements parameter and value.
An objective function.
The initial parameter vector.
Optionally additional arguments to be passed to objective.
Defines the output parameter.
Defines the output value.
A delay in number of seconds.
The probability for throwing a warning.
The probability for throwing an error.
The warning message.
The error message.