Dear All,

I am trying to replicate on Dynare the (cobb-douglas) model introduced by Ramey&Shapiro(1998).

The model is a 2 sectors RBC model with government purchases and costly capital reallocation. It is summarized in the following short pdf:

ramey_shapiro1998.pdf (178.5 KB)

The shock consists of extra persistent government purchases from sector 2 (i.e. it simulates the effects of a military build-up). The social planner in the model can build up the capital stock in sector 2 by either:

- Giving up consumption of good 2 (standard Euler equation - consumption saving trade-off).
- Shifting capital from sector 1 to sector 2. However shifting capital is costly (extra depreciation \gamma = 0.50).

Denoting by R_1 the amount of capital shifted from sector 1 to sector 2, we must have that R_1 \ge 0, which represents my occasionally binding constraint. In Dynare I write:

occbin_constraints;

name âshiftâ; bind r1 > 0;

end;

I intend to solve the model in perfect foresight, starting from a steady state where R_1 = 0, which represents the binding regime M1, to use the same notation in Guerrieri&Iacoviello(2015).

In response to the shock (dG_2>0), I expect to observe some capital shifted from sector 1 to sector 2 (this is what happens in the original paper). In this case, R_1>0, which represents the ârelax-regimeâ M2.

**My Problem:** Even if my code runs without errors, capital is never shifted, i.e. R_1 =0 in all the periods of the occbin simulation. Assuming I correctly specified the model (I obtain the same steady state reported in the paper), there must be something incorrect in the way I coded up the occasionally binding constraint.

My code is available here:

RS98_occbin.mod (3.8 KB)

Any help or advice would be extremely appreciated. Thanks in advance.

Edoardo