Dear Professor Jpfeifer,

I have a model on rollover crisis, an extended model of Gertler and Kiyotaki (2015). I was wondering if it is possible to simulate the model with the extended path method. The story is: At t=0, there is a standard RBC model with banking. At t=1,there is a shock which makes the control variable nw<0. When nw<0, banking system shuts down for just one period and the economy works in a standard RBC environment without banking. at t=2, the economy again starts in the initial environment with banking with the initial values of the end of t=1 and goes to the steady state of the model with banking.

Thank you for your great help.

Sincerely,

Leo

This sounds like a general perfect foresight setup where you can use the extended path or the standard solvers.

Thank you professor. The problem is I have a switch regime. In fact, I have two different models, a model with banking and a model without banking. How I can feed this to dynare and ask dynare to use the first model (with Steady state#1) in period one , then switch to the second model (with different steady state, let’s say SS#2) and again come back to the first one? All I found about the extended path is about ZLB. Is there any reference can helps me feed dynare with correct codes.

I think it should be possible with a lot of work. You would have to define the two models for all the endogenous variables (say y1 for the first regime and y2 for the second regime) in the model block and add equations to define the conditions under which y is equal to y1 or y2. The expected terms in both regimes would have to be expressed as functions of y (not y1 or y2). But I do not understand if the switches are endogenous or imposed in your story… With the set-up I describe, they would be endogenous.

Best,

Stéphane.

Thank you Stepan,

I have both model and their codes. in fact, I do not know how to put what you told in dynare. Could you please give me an example(codes,text,etc)? My model is the improved version of Gertler and Kiyotaki (2015). They have their matlab code to simulate the perfect foresight path (which uses also dynare) of rollover crisis. Professor Christiano advised me to do that with extended path because the results could be more reliable. The switch happens when let’s say nw is negative. and nw could be negative if a big enough idiosyncratic shock hit the economy.

Sincerely,

Leo

So the switch is endogenous. I do not have such an example. As far as I understand it should not be very different from what we do to simulate a model with occasionally binding constraints (on a control variable like investment, not on the nominal interest rate of a Taylor rule). Something like:

```
var Capital, Output, Labour, Consumption, Investment, Output1, Labour1, Consumption1, Output2, Labour2, Consumption2, Efficiency, efficiency, ExpectedTerm, LagrangeMultiplier;
varexo EfficiencyInnovation;
parameters beta, theta, tau, alpha, psi, delta, rho, effstar, sigma;
// Calibration
beta = 0.990;
theta = 0.357;
tau = 2.000;
alpha = 0.450;
psi = -1.000;
delta = 0.100;
rho = 0.800;
effstar = 1.000;
sigma = 0.150;
model;
efficiency = rho*efficiency(-1) + sigma*EfficiencyInnovation;
Efficiency = effstar*exp(efficiency);
(((Consumption1^theta)*((1-Labour1)^(1-theta)))^(1-tau))/Consumption1
- beta*ExpectedTerm(1) + LagrangeMultiplier(1)*beta*(1-delta);
ExpectedTerm = ((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)
*(alpha*((Output/Capital(-1))^(1-psi))+1-delta);
LagrangeMultiplier = max((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption
- beta*ExpectedTerm(1) + LagrangeMultiplier(1)*beta*(1-delta), 0);
((1-theta)/theta)*(Consumption1/(1-Labour1)) - (1-alpha)*(Output1/Labour1)^(1-psi);
Output1 = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour1^psi))^(1/psi);
Consumption2 = Output2;
((1-theta)/theta)*(Consumption2/(1-Labour2)) - (1-alpha)*(Output2/Labour2)^(1-psi);
Output2 = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour2^psi))^(1/psi);
Consumption = (Output1>Consumption1)*Consumption1 + (1-(Output1>Consumption1))*Consumption2;
Labour = (Output1>Consumption1)*Labour1 + (1-(Output1>Consumption1))*Labour2;
Output = (Output1>Consumption1)*Output1 + (1-(Output1>Consumption1))*Output2;
Capital = Output-Consumption + (1-delta)*Capital(-1);
Investment = Capital - (1-delta)*Capital(-1);
end;
```

Variables ending with 2 are in the constrained regime (investment is zero), variables ending with 1 are in the unconstrained regime (investment is strictly positive).

Best,

Stéphane.

Thank you very much Stepan, It is a great hint to what I am searching for. Just for more clarification, I was wondering if it is possible to share the model and full codes of your previous message (if there is a link or …)?

You can find the whole mod file on our Github repository. I posted it years ago, so I am not sure that it is doing what it is supposed to do… You need `rbcii.mod`

and `rbcii_steady_state.m`

to run the simulation. I will try to post it elsewhere with more explanation this week or next week.

Best,

Stéphane.

Thank you Stéphane. I will look at them. Please let me know when you share the new file with more explanations. That can really help me.

Sincerely,

Leo