now based on centroid calculations A function that optimizes a set of parameters against a function. This optimization method is based on Amoeba optimization. We use a form of the Downhill Simplex Method or Nelder-Mead (available as the R function optim). This can also be coded in other languages.