I am trying to minimize a simple noisy function:
function(x,prec=10){x^2+rnorm(1)/(prec)}
The noise is moderate, i.e., it should be fairly easy to find the optimum at 0.
What I consider important here, is that the noise is independent, i.e., repeatedly evaluating the same point would move you closer to the true (noiseless) value. The optimizer could take advantage of that. Bu I am not sure how.
I am using mlrMBO
in R to optimize, but fail to get a good result. The code below estimates the min at 0.032, and increasing iters
does not seem to improve the result at all.
library(mlrMBO)
f1<-function(x,prec=10){x^2+rnorm(1)/(prec)}
obj.fun = makeSingleObjectiveFunction(name = "noisy_parable", fn = f1, par.set = makeNumericParamSet("x", 1, -3, 3), noisy = TRUE)
ctrl = makeMBOControl(final.method = "best.predicted", final.evals = 1)
ctrl = setMBOControlInfill(ctrl, crit = crit.eqi)
ctrl = setMBOControlTermination(ctrl, iters = 10)
configureMlr(on.learner.warning = "quiet", show.learner.output = FALSE)
set.seed(1)
res = mbo(obj.fun, control = ctrl, show.info = FALSE)
print(res$x)
My intuition would be that increasing iter
could continue to improve the result up to an arbitrarily accurate result: The logic being that, as we're moving closer to the optimum, the optimizer could exploit the independence of the noise to increase accuracy by repeatedly evaluating the same/similar points.
I think this is a fairly generic setup (noisy optimization with independent noise), so I thought the optimizer would have this built in, controllable via a tuning parameter. If this is not the case, is there a way to implement this using mlrBMO
?
Background: In my actual application evaluating the function is very costly (>2 seconds for a noise that roughly equals the example above), so I would gain a lot my starting of a noisy function and then only increase the precision (by repaetedly evaluating the same points) as I move closer to the optimum.
A related, more broadly framed (What is a good algorithm for this kind of problem?) is asked and answered by myself here: https://math.stackexchange.com/questions/3376670/efficient-algorithm-to-search-minimum-of-function-with-noise/3397309#3397309