direct1d(f, a, b, maxiter = 20, ...)
a.
xmin
and fmin
, the minimum found so far
and its function value.Finkel, D., and C. Kelley (2006). Additive Scaling and the DIRECT Algorithm. Journal of Global Optimization, Vol. 36, No. 4, pp. 597--608.
findmins
, dfoptim::direct
f <- function(x) sin(10*pi*x) + 0.5*(x-0.5)^2
a <- 0; b <- 1
direct1d(f, 0, 1, maxiter = 20)
# $xmin: 0.5499493794 (error: 3.5e-6)
# $fmin: -0.9987512652
ezplot(f, a, b, 1000)
Run the code above in your browser using DataLab