# Loss function and OSR command

**URL:** https://forum.dynare.org/t/loss-function-and-osr-command/20071
**Category:** Optimal Policy
**Created:** [4 April 2022 22:35 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071 "2022-04-04T22:35:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![nmklipm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/n/b487fb/32.png) [@nmklipm](https://forum.dynare.org/u/nmklipm)
#### Post date: [4 April 2022 22:35 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/1 "2022-04-04T22:35:44Z")

</div>

Hi everyone,  
I am currently working on a model similar to ALLV (2005), but more simple, from what i understand, in the Ramses model, the steady state is inneficient so, could it be posible to use the ramsey\_model or the osr commands? or i need and efficient steady state? My plan is to estimate and evaluate different monetary policy rules, but i am stuck with that part.

thanks in advance.

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [5 April 2022 10:05 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/2 "2022-04-05T10:05:30Z")

</div>

The issue with the inefficient steady state is mostly about the approximation order required. For `ramsey_model` that is not an issue. You can simply go to second order. The `osr`-command in contrast only works with linear models, so a inefficient steady state is a problem. But you could implement OSR manually at higher order.

---

<div class="post-metadata">

### Author: ![nmklipm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/n/b487fb/32.png) [@nmklipm](https://forum.dynare.org/u/nmklipm)
#### Post date: [6 April 2022 19:46 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/3 "2022-04-06T19:46:52Z")

</div>

Thank you for your answer professor

I followed your approach and changed my model to a non-linear form, I learned how to recursively derive calvo price equation, however i have a small doubt, in one of your examples, the price FOC is as follows:

![image](https://forum.dynare.org/uploads/default/original/2X/d/d31dc19c6f5338e5cea3d266e1dc905e32abed8e.png)

and for the importing firms in an incomplete pass-through environment, following your notation, the FOC of the importing companies would be:

![image](https://forum.dynare.org/uploads/default/original/2X/e/e034e311076048cbae45e1dc718e6775e3cd33ca.png)

or do I need to divide by the general price level instead of the general price of imported goods?

Thanks!

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [7 April 2022 09:02 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/4 "2022-04-07T09:02:19Z")

</div>

The deflator is put here to be able to use the real stochastic discount factor \Lambda\_{t,t+k}. That factor applies to real cash flows in terms of the final good. Thus, the deflator needs to be the one of the consumption good.

---

<div class="post-metadata">

### Author: ![nmklipm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/n/b487fb/32.png) [@nmklipm](https://forum.dynare.org/u/nmklipm)
#### Post date: [7 April 2022 16:33 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/5 "2022-04-07T16:33:02Z")

</div>

That makes sense, thanks a lot professor.

Best regards

---

<div class="post-metadata">

### Author: ![AnaGr](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnaGr](https://forum.dynare.org/u/AnaGr)
#### Post date: [18 April 2022 18:19 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/6 "2022-04-18T18:19:42Z")

</div>

Hi all

I am working with a similar model (Adolfson, et al. 2005), so I would like to know if another solution to this kind of problem would be to add non-distortionary taxes to restore the efficient steady state to be able to use the osr command? If so, in the case of models like this one, where there is monopolistic competition in several sectors (domestic sector, import and export sector, etc), to restore the efficient steady state, is it valid to just add a lump sum tax to each sector?

Thanks in advance!  
Ana

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [23 April 2022 14:08 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/7 "2022-04-23T14:08:34Z")

</div>

1. In that case, I would suggest to manually do the OSR by optimizing over policy rules and defining the planner objective in the model block.
2. No, a lump sum tax can generally not be used to alleviate a distortion on the margin.

---

<div class="post-metadata">

### Author: ![siriy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@siriy](https://forum.dynare.org/u/siriy)
#### Post date: [12 September 2024 09:20 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/8 "2024-09-12T09:20:47Z")

</div>

Hi all. I am conducting a policy frontier as guided here: [Policy frontier](https://forum.dynare.org/t/policy-frontier/5910). Running into this thread,  
I now have several questions (and confusions).

1. I wonder what is the exact definition of ‘inefficient steady state’ under this thread? NK models are inefficient by construction, does this mean that a policy frontier analysis using OSR is invalid?

2. In which condition(s) one might run into ‘inefficient steady state’?

3. When should one concerns about ‘inefficient steady state’ and avoid using OSR command to derive the policy frontier.

Very much looking forward to be enlightened!

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [12 September 2024 10:16 UTC](https://forum.dynare.org/t/loss-function-and-osr-command/20071/9 "2024-09-12T10:16:40Z")

</div>

1. Yes, NK models have an inefficient steady state unless there is an employment subsidy to counteract the effect of monopolistic competition.
2. Monopolistic competition ist the most common one.
3. It’s often preferable to use a full-blown welfare analysis rather than OSR in Dynare. The former is more flexible and allows using welfare as opposed to unconditional variances as the objective.
