I need to find a minimum of a two-variable function. I currently use the R function optim()
but I have just found out that the result varies based on the trial values passed to the function. How to solve this problem?
That is the function I refer to
optim(par, fn, gr = NULL, ...,
method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN",
"Brent"),
lower = -Inf, upper = Inf,
control = list(), hessian = FALSE)