Optimal policy parameters in a non-linear model

I am using Dynare (version 5.3) now.

Please use Dynare 6.

Hi all,

I am trying to find an optimal tax rate using welfare objective/get_minus_welfare_objective.m above. I tried both csminwel and cmaes to search for the solution. Turns out the solution is the initial value for both methods. I looped my tax rate over some plausible range, and confirmed that oo._mean and variance of welfare do vary with it. Does anyone perhaps have any idea on how to cope with this? I am using Dynare 4.6, does this have anything to do with the problem I am facing?
Thank you.

Without seeing the codes it is impossible to tell. That being said, please use a recent Dynare version.