# Two m files and two mod files

**URL:** <https://forum.dynare.org/t/two-m-files-and-two-mod-files/16093>\
**Category:** Optimal Policy\
**Created:** [19 June 2020 02:32 UTC](https://forum.dynare.org/t/two-m-files-and-two-mod-files/16093 "2020-06-19T02:32:35Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![HelloDynare](https://forum.dynare.org/user_avatar/forum.dynare.org/hellodynare/32/12107_2.png) [@HelloDynare](https://forum.dynare.org/u/HelloDynare)\
**Post date:** [21 June 2020 07:09 UTC](https://forum.dynare.org/t/two-m-files-and-two-mod-files/16093/7 "2020-06-21T07:09:01Z")

</div>

Hello littlemacro,

I do not answer the question. I’m a beginner as well 😁  
Allow me to leave some messages here. Hope they are helpful.

First, this BK violation means there exists at least one error in your model.  
One strategy is to go backward. Simplify your model until the new one can actually work.  
However, as you said, if in Ramsey scenario, removing the equation of  
Welf\_t = U\_t+\beta Welf\_{t+1}  
(and its variable, steady state claims,) it will work.  
So the current version of code has already been a Minimal Working Example (MWE) 🤣

Second, recently I’m reading the code below

> <https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Born_Pfeifer_2018/Welfare/Born_Pfeifer_2018_welfare.mod>

Let’s focus on a few parts:  
line 423-426

```
@#if Ramsey_policy==0    
    [name='Recursive Welfare']
    Recursive_Welfare=Utility+betta*Recursive_Welfare(+1);
@#endif

```

line548-550

```
@#if Ramsey_policy==0    
    Recursive_Welfare=1/(1-betta)*Utility;
@#endif    

```

line578-584

```
@#if Ramsey_policy==1
    planner_objective Utility;
    ramsey_model(instruments=(R),planner_discount=betta);
    initval;
    R=1/betta;
end;
@#endif

```

They give me the impression that the Ramsey case does not couple with the welfare equation:  
Welf\_t = U\_t+\beta Welf\_{t+1}??  
But I really saw some optimal Ramsey papers contain it, at least when they apply Levin’s package.

I also notice a post below:

> [@Comparing welfare - Ramsey vs Taylor rule](https://forum.dynare.org/t/comparing-welfare-ramsey-vs-taylor-rule/6191):
>
> Hello, I have a quick question about the possibility to compare welfare that we get from a second order approximation with the planner objective value from a Ramsey policy. In the case of a Taylor rule I have specified the welfare recursively as Welf = Util + \beta\*Welf(+1) From the output of Dynare I have understood that you could then either look at the stochastic steady state computed as W\_pos=strmatch('y',M\_.endo\_names,'exact'); oo\_.dr.ys(W\_pos)+0.5\*oo\_.dr.ghs2(oo\_.dr.inv\_order\_var(W\_pos…

The author calculates the recursive conditional welfare only in the Taylor rule, while keeping it absent in the Ramsey policy.

Regards

---

_[View the full topic](https://forum.dynare.org/t/two-m-files-and-two-mod-files/16093)._
