Sequence of shocks in deterministic model?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Sequence of shocks in deterministic model?

Postby brown3c » Wed Nov 13, 2013 2:04 am

Hi, could anyone tell me how I can simulate slowly increasing productivity in a deterministic model like the following one? I want z to increase linearly from 0 to 0.1 over 20 periods. Thanks for your help!

var y c k i l y_l w r ;
varexo z;

parameters beta psi delta alpha sigma epsilon;
alpha = 0.33;
beta = 0.99;
delta = 0.023;
psi = 1.75;
sigma = (0.007/(1-alpha));
epsilon = 10;


model;

(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
y_l = y/l; end;


initval;
k = 9;
c = 0.7;
l = 0.3;
w = 2.0;
r = 0;
z = 0;
end;
steady;

endval;

z = 0.1;
end;
steady;


check;
simul(periods=2100);
brown3c
 
Posts: 6
Joined: Sun Sep 11, 2011 10:48 am

Re: Sequence of shocks in deterministic model?

Postby StephaneAdjemian » Thu Nov 28, 2013 11:37 am

Hi,

You need to define the productivity innovations in the shoks block (described in section 4.8 of the manual). You can do something like:

Code: Select all
shocks;
var z;
periods 1:20;
values (transpose((linspace(0.005,.1,20)));
end;


A full example is given in this Gist.

Best,
Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Sequence of shocks in deterministic model?

Postby louisdupuy » Wed Dec 04, 2013 1:44 pm

Dear Stephane,

First I'd like to thank you for the support on the forum, a lot of useful advice that got me through most of the previous difficulties I faced. Still, this time I am stuck.

I am trying to study the transition from one steady state to another in a deterministic (trade/growth) model, and so I used the initval and endval blocks as shown in the example file on Gist. When I test your file on my installation it works nicely, but when I run my code it doesn't. It seems dynare does not "pick" my initval block and runs on the endval block only. I tried to add a shock, which works taking as steady-states values the endval block. Both initval and endval are filled with steady states as computed separetaly depending on the exogenous variables. Any idea what is going on?

model_cs.m
(10.12 KiB) Downloaded 123 times

model_cs.mod
(3.62 KiB) Downloaded 131 times


Many thanks,

Louis
louisdupuy
 
Posts: 2
Joined: Wed Dec 04, 2013 1:26 pm

Re: Sequence of shocks in deterministic model?

Postby StephaneAdjemian » Wed Dec 04, 2013 5:14 pm

Dear Louis,

The Blanchard and Kahn conditions are not satisfied... You have more leaded variables than explosive eigenvalues (->indeterminacy). Also, there is no lag (states) in your model, all the variables are determined by the terminal condition (so I don't understand the purpose of the initval block in this context)... I wonder if this is really intentional from your part and I suspect a timing error (in the law of motion for the capital stocks?).

Best,
Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Sequence of shocks in deterministic model?

Postby louisdupuy » Thu Dec 05, 2013 12:42 pm

Dear Stéphane,

I feel a bit silly to be honest, as I should have used the "check" command before asking (I did that on a previous version of the model and forgot to check again). It was easier to do the algebra with forward variables, hence the look of the law of motions. The solution was indeed to lag the law of motion for capital and consumption. Simulation working just fine now!

Thanks for your time, you just saved a chapter!

Best,

Louis
louisdupuy
 
Posts: 2
Joined: Wed Dec 04, 2013 1:26 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 9 guests