I’d be glad to know whether my mcp-tag is set correctly (I believe not, since e.g. varying the parameter value does not change anything in the graphs. But I can’t figure out where the bug is).

demand_shock_gov_purchases_money.mod (4.5 KB)

I’d be glad to know whether my mcp-tag is set correctly (I believe not, since e.g. varying the parameter value does not change anything in the graphs. But I can’t figure out where the bug is).

demand_shock_gov_purchases_money.mod (4.5 KB)

Please reupload the file. The link seems to be broken

Now the file works, but you need to tell me what the logic is here. What you are currently doing is:

```
l=c-eta*di;
```

is valid if `di>-0.005`

. Otherwise, use

```
di=-0.005
```

Looking at the plot for `di`

, this seems to work as expected.

Yes exactly, because that’s how I understand it and I thus implemented it like that - based on this:

But there must be a bug since my problem is, that I get the same results for the debt-financing (blue) and the money-financing (red) case (uploaded code here). But they should be slightly different:

Thus, I might should code it sligthly different to get this difference between the two financing systems. But how else would you program these inequality constraints?

Thank you very much, I appreciate your help!

(28) and (29) are two constraints you need to add (two tags). In case of debt financing, (30) seems to be an additional complementary slackness condition. Did you add that?

Yes, I am aware that these are two constraints: (28) is the ZLB constraint and (29) a slackness condition. But to my knowledge, due to the variables (c and i), Dynare is not able to implement a tag for an inequality constraint like (29). That’s why my understanding is, that equation (27) incorporates both inequality constraints: either the part in the brackets on the left is zero and the part in the brackets on the right counts or vice versa. And since log(beta)=log(0.995)= - 0.005, I did it with only one tag for the money-financed case. But by doing so, I get the same results as for the debt case (but they should be slightly different).

So far, I managed to get the results for the debt case without a tag (see attached mod-file). If I would replace equation 38 with 39 and 40 in order to implement a tag, it switches to homotopy and cannnot solve the perfect foresight model:

demand_shock_gov_purchases_debt.mod (4.6 KB)

But since my results for the debt case are good (meaning I can replicate it), the bug must lie in the money-financed code, since there, e.g., output should be about -2 (not -2.5) and the real rate should be 1 (not 2).

Which paper are we talking about?

Sometimes you can use `robust_lin_solve`

together with the complementary slackness conditions (instead of tags)

Using “robust_lin_solve” did not change anything.

But I’ve got it now (after fixing a stupid bug). Anyway, thank you very much for your effort!

Could you then maybe provide the final mod-file?

All my drafts aiming at replicating the working paper “The Effects of a Money-Financed Fiscal Stimulus” by Jordi Gali (2017) can be found on: https://github.com/LNYB (please let me know if you have any corrections or additions)

Hi，not find your final mod file， deleted？