Restricting parameters in Dynare


I am trying to optimize the parameters of a simple Taylor rule in a neo-keynisian enviroment.

The parameters turn out to be non-sensical. I was wondering if you could give me some insight:

  1. Is there a possibility to impose a restriction to the parameters.
  2. If not, what do you recommend?

Thank you,

Which context are we talking about? In OSR, this is not easily possible yet.
In estimation, you can use the estimated_params-block to set upper and lower bound for your parameters or specify a prior that does not allow the parameters to be bigger than certain bounds.

Thank you for your reply.

Actually, I was thinking of implementing it on an OSR…could you help me providing some guidance in order to do this?

Thank you again.

Kind Regards,

This is somewhat complicated. Please provide your current codes and indicate the bounds you want to set and I will try post an example.

Thank you again for your reply.

This is my mod file.

Kind Regards,
sinramsey.mod (4.21 KB)

Dear Germán,

you need to use the current unstable version (to be Dynare 4.5) with the attached files. In osr_optimizer_function_wrapper.m you can manually change the bounds (and the optimizer to use). It currently requires a Matlab Toolbox as I am using fmincon as an example. Note also that there is a bug in the current unstable that will soon be fixed. You need to replace in dynare_minimize_objective.m the calls to


sinramsey.mod (4.25 KB)
osr_optimizer_function_wrapper.m (689 Bytes)

Dear Dr. Pfeifer,

does this solution already apply to the current stable version of Dynare? Thanks

No, it only works with the unstable, to be published as Dynare 4.5

Hello Johannes,

After reading your code, I’m wondering whether osr now works with second order approximation to the model’s policy function? (I’m asking because of the “order=2” in the osr command).


No, because a first order approximation already delivers second-order accuracy in the unconditional moments, which osr minimizes. Going to second order would yield fourth-order accuracy.