Optim.jl NelderMead, how to avoid stucking situation?

I think this is a question more related to optimization than Julia’s.

I figured out that Optim.jl NelderMead algorithm doesn’t support fminbox. The out-of-boundary search is not a real problem because I can impose some penalties. However, sometimes it causes errors in my model estimation (e.g., I have to impose a log on an object, but when a constraint is not satisfied, the object turns out to be negative).

I naively thought that I could return large values for those cases whenever the estimation was not properly implemented. However, then the algorithm gets stuck on the domain there.

I’m general, neadlermead is a pretty bad algorithm. it isn’t even guaranteed to converge to local minima