There is really something weird happening with optim. really puzzled but what could go wrong.
So when I run: optr = optimize(objfun,sps0,method = :nelder_mead,iterations=2000) The algorithm stops after precisely 10 function evaluations. Output: **** Results of Optimization Algorithm * Algorithm: Nelder-Mead * Starting Point: [0.66,0.5,-0.3,0.05,5.0,2.0,3.0,2.0,3.0] * Minimum: [0.7600000000000002,0.6000000000000001, ...] * Value of Function at Minimum: 2438.299855 * Iterations: *2000* * Convergence: false * |x - x'| < NaN: false * |f(x) - f(x')| / |f(x)| < 1.0e-08: false * |g(x)| < NaN: false * Exceeded Maximum Number of Iterations: true * Objective Function Calls: *2010* * Gradient Call: 0 **** As you can see Objective Function Calls: 2010 and Iterations: 2000 while I am sure there are just functions evaluations (1000-2000). Anyone has any clue what could be causing this? Should I reset iterations number somewhere? how to do that? many thanks!!!