Using osr in specific cases

Dear Prof Pfeifer

I would like to seek your help on the osr command.

  1. I would like to find the value of a parameter (phiP) which maximizes welfare (following a technology shock). I understand there is no boxed solution for this, but I would really appreciate if you can direct me on how I can implement this. I would like to incorporate this in the cycle_irf.mod file in the attached folder, which contains the code for the technology shock and also has the welfare function (Welf).

  2. Also, is there a way to use the osr command with the non-linear newton rhapson solver algorithm? I tried to do this in the transition.mod file, but it does not seem to work. As in the above file, I also want to find the welfare maximizing value of phiP.

To run either of these files, it needs to be done in the run.m file. Please set deterministic=1 to run transition.mod and =0 to run cycle_irf.mod.

Many thanks.

osr (2.4 MB)

please do not post the some topic twice.

  1. I posted an example at
  2. I am not sure I understand what you are trying to do. OSR is about stochastic models. The mod-file you have is a perfect foresight one.

Dear Prof. Pfeifer,

My apologies. I just realized I had posted it in the wrong section initially.
Many thanks for your help on 1).
With regards to 2), I am trying to find the path for a policy rule which maximizes welfare by choosing the value of a parameter which goes into the rule. Is there a way I can achieve this in this setting?

Many thanks.