powered by
Minimising a continuous univariate function using the golden section search algorithm.
goldensearch(fn, interval, tol = 1)
the function; should be scalar valued
a vector containing the lower and upper bounds of search
tolerance level for convergence
a list of objects
k: minimiser
value: mimimum value
iter: number of iterations before convergence
iterfn: number of function evaluations
# NOT RUN { fn = function(x) (x-1)^2; goldensearch(fn=fn,interval=c(-2,3),tol=1) # }
Run the code above in your browser using DataLab